Help with Procedure keyword

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Help with Procedure keyword

Weldy,Ryan
I’m working with DBUnit for the first time and trying to create a table called “V500.PROCEDURE”. Since PROCEDURE is a key word, it would appear that it’s having an issue during setup and deleting the table as you can see in the stacktrace below [1]. Is there any way around this? A snippet from my generated xml file is here [2]. I’m using dbunit-2.4.8 and derby-10.8.2.2. Code I’m using to create the table is here [3].
 
[1]
java.sql.SQLSyntaxErrorException: Syntax error: Encountered "PROCEDURE" at line 1, column 18.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
        at com.cerner.system.jdbc.metadriver.proxy.StatementProxy.execute(StatementProxy.java:233)
        at org.dbunit.database.statement.SimpleStatement.executeBatch(SimpleStatement.java:69)
        at org.dbunit.operation.DeleteAllOperation.execute(DeleteAllOperation.java:126)
        at org.dbunit.operation.CompositeOperation.execute(CompositeOperation.java:79)
        at org.dbunit.AbstractDatabaseTester.executeOperation(AbstractDatabaseTester.java:190)
        at org.dbunit.AbstractDatabaseTester.onSetup(AbstractDatabaseTester.java:103)
        at org.dbunit.DatabaseTestCase.setUp(DatabaseTestCase.java:156)
        at com.cerner.extract.millennium.crawler.procedure.extract.DiscoverOperationTest.setUp(DiscoverOperationTest.java:65)
        at junit.framework.TestCase.runBare(TestCase.java:132)
        at junit.framework.TestResult$1.protect(TestResult.java:110)
        at junit.framework.TestResult.runProtected(TestResult.java:128)
        at junit.framework.TestResult.run(TestResult.java:113)
        at junit.framework.TestCase.run(TestCase.java:124)
        at junit.framework.TestSuite.runTest(TestSuite.java:243)
        at junit.framework.TestSuite.run(TestSuite.java:238)
        at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.sql.SQLException: Syntax error: Encountered "PROCEDURE" at line 1, column 18.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
        ... 30 more
Caused by: ERROR 42X01: Syntax error: Encountered "PROCEDURE" at line 1, column 18.
        at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
        at org.apache.derby.impl.sql.compile.ParserImpl.parseStatement(Unknown Source)
        at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)
        at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
        at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown Source)
        ... 24 more
 
 
[2]
<dataset>
  <V500.PROCEDURE ACTIVE_IND="1" PROCEDURE_ID="118565792"/>
  <V500.PROCEDURE ACTIVE_IND="0" PROCEDURE_ID="130153277"/>
</dataset>
 
[3]
                   try {
                jdbcConnection
                        .prepareStatement(
                                "CREATE TABLE \"PROCEDURE\" (ACTIVE_IND smallint, PROCEDURE_ID bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY)")
                        .execute();
            } catch (SQLException e) {
                // ignore table exists exception
                if (!"X0Y32".equals(e.getSQLState()))
                    throw e;
            }
Thanks,
Ryan
 
 

CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.

------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for
developers. It will provide a great way to learn Windows Azure and what it
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user