I build a very small test case with a mysql table in Input and a JavaDB table four output.
I just insert have one field (integer) in my javadb output table.
I have a silly error message about a syntax error:
Exception in component tJavaDBOutput_1
java.sql.SQLSyntaxErrorException: Syntax error: Encountered "(" at line 1, column 39.
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 test.injection_0_1.injection.tMysqlInput_1Process(injection.java:1067)
at test.injection_0_1.injection.runJobInTOS(injection.java:1909)
at test.injection_0_1.injection.main(injection.java:1826)
Caused by: java.sql.SQLException: Syntax error: Encountered "(" at line 1, column 39.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
... 11 more
Caused by: ERROR 42X01: Syntax error: Encountered "(" at line 1, column 39.
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)
... 5 more
may be these linea cause the error ?
stmtCreate_tJavaDBOutput_1
.execute("CREATE TABLE \""
+ tableName_tJavaDBOutput_1
+ "\"(\"ID\" INT(10,0) not null ,primary key(\"ID\"))");
but it is a code generated by Talend !
to be sure, I have destoryed all the " to produce this code
stmtCreate_tJavaDBOutput_1
.execute("CREATE TABLE
+ tableName_tJavaDBOutput_1
+ " (ID INT(10,0) not null ,primary key(ID))");
but always this stack error:
connecting to socket on port 3684
connected
Exception in component tJavaDBOutput_1
java.sql.SQLSyntaxErrorException: Syntax error: Encountered "(" at line 1, column 39.
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 test.injection_0_1.injection.tMysqlInput_1Process(injection.java:1077)
at test.injection_0_1.injection.runJobInTOS(injection.java:1971)
at test.injection_0_1.injection.main(injection.java:1881)
Caused by: java.sql.SQLException: Syntax error: Encountered "(" at line 1, column 39.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
... 11 more
Caused by: ERROR 42X01: Syntax error: Encountered "(" at line 1, column 39.
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) disconnected
... 5 more
it seems that the syntax generated by Talend is not correct: create table foo (ID INT(10,0) not null ,primary key(ID))