DB2 ODBC Connector error
drprasad Mar 21, 2009 7:25 AMGreetings,
Kindly provide us the solution for the following problem. My Java program is in need of fetching the result from the VDB. We are going with teiid-embedded to get our result from the VDB as and when needed.
I first created a ODBC connector and DSN for Accessing the MS-Access Tables. I created a model for an MS-Access DB Table. I associated the Model of the table with the ODBC connector. After that, I created a simple VDB to access the data from that table,I executed the same using a simple SQL query. It was then set in the Classpath for the teiid-embedded stand alone Java ,it executed properly and I got my result set.
Again I created a DB2 Connector with DSN using ODBC connectivity. I followed the same steps that I followed for the MS-Access table that I have explained before for the DB2 table. This time teiid-embedded is giving me the "General error" when the sql Statement is executed. I was returning me the connection object properly and the statement object as well as properly. But at the executeQuery it was throwing the "General error". Please find the error message as follows.
com.metamatrix.jdbc.MMSQLException: Error occurred on connector harini_1.DB21 - com.metamatrix.data.exception.ConnectorException: java.sql.SQLException: General error
at com.metamatrix.jdbc.MMSQLException.create(MMSQLException.java:85)
at com.metamatrix.jdbc.MMSQLException.create(MMSQLException.java:66)
at com.metamatrix.jdbc.MMStatement.setException(MMStatement.java:364)
at com.metamatrix.jdbc.MMStatement.processQueryMessage(MMStatement.java:441)
at com.metamatrix.jdbc.MMStatement.executeSql(MMStatement.java:540)
at com.metamatrix.jdbc.MMStatement.executeQuery(MMStatement.java:507)
at JDBCClient.execute(JDBCClient.java:81)
at JDBCClient.main(JDBCClient.java:42)
Caused by: [MetaMatrixComponentException]Error occurred on connector harini_1.DB21 - com.metamatrix.data.exception.ConnectorException: java.sql.SQLException: General error
1 [ConnectorException]Error occurred on connector harini_1.DB21 - com.metamatrix.data.exception.ConnectorException: java.sql.SQLException: General error
2 [ConnectionPoolException]com.metamatrix.data.exception.ConnectorException: java.sql.SQLException: General error
3 [ConnectorException]java.sql.SQLException: General error
4 [SQLException]General error
at com.metamatrix.dqp.internal.process.DataTierTupleSource.switchBatch(DataTierTupleSource.java:149)
at com.metamatrix.dqp.internal.process.DataTierTupleSource.nextTuple(DataTierTupleSource.java:90)
at com.metamatrix.query.processor.relational.AccessNode.nextBatchDirect(AccessNode.java:155)
at com.metamatrix.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:243)
at com.metamatrix.query.processor.relational.BatchCollector.collectTuples(BatchCollector.java:59)
at com.metamatrix.query.processor.relational.BatchCollector.collectTuples(BatchCollector.java:53)
at com.metamatrix.query.processor.relational.SourceState.collectTuples(SourceState.java:100)
at com.metamatrix.query.processor.relational.JoinStrategy.loadRight(JoinStrategy.java:70)
at com.metamatrix.query.processor.relational.MergeJoinStrategy.loadRight(MergeJoinStrategy.java:358)
at com.metamatrix.query.processor.relational.JoinNode.nextBatchDirect(JoinNode.java:178)
at com.metamatrix.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:243)
at com.metamatrix.query.processor.relational.ProjectNode.nextBatchDirect(ProjectNode.java:175)
at com.metamatrix.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:243)
at com.metamatrix.query.processor.relational.RelationalPlan.nextBatch(RelationalPlan.java:111)
at com.metamatrix.query.processor.QueryProcessor.process(QueryProcessor.java:149)
at com.metamatrix.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:276)
at com.metamatrix.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:220)
at com.metamatrix.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:46)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: com.metamatrix.data.exception.ConnectorException: Error occurred on connector harini_1.DB21 - com.metamatrix.data.exception.ConnectorException: java.sql.SQLException: General error
at com.metamatrix.dqp.internal.datamgr.impl.ConnectorWorkItem.handleError(ConnectorWorkItem.java:245)
at com.metamatrix.dqp.internal.datamgr.impl.ConnectorWorkItem.process(ConnectorWorkItem.java:184)
at com.metamatrix.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:46)
at com.metamatrix.dqp.internal.datamgr.impl.SynchConnectorWorkItem.run(SynchConnectorWorkItem.java:70)
... 3 more
Caused by: com.metamatrix.data.pool.ConnectionPoolException: com.metamatrix.data.exception.ConnectorException: java.sql.SQLException: General error
at com.metamatrix.data.pool.ConnectionPool.createConnection(ConnectionPool.java:378)
at com.metamatrix.data.pool.ConnectionPool.obtain(ConnectionPool.java:302)
at com.metamatrix.connector.jdbc.JDBCConnector.getConnection(JDBCConnector.java:164)
at com.metamatrix.dqp.internal.datamgr.impl.ConnectorWorkItem.createConnection(ConnectorWorkItem.java:149)
at com.metamatrix.dqp.internal.datamgr.impl.ConnectorWorkItem.createExecution(ConnectorWorkItem.java:355)
at com.metamatrix.dqp.internal.datamgr.impl.SynchConnectorWorkItem.createExecution(SynchConnectorWorkItem.java:101)
at com.metamatrix.dqp.internal.datamgr.impl.ConnectorWorkItem.process(ConnectorWorkItem.java:162)
... 5 more
Caused by: com.metamatrix.data.exception.ConnectorException: java.sql.SQLException: General error
at com.metamatrix.connector.jdbc.JDBCSourceConnectionFactory.createJDBCConnection(JDBCSourceConnectionFactory.java:116)
at com.metamatrix.connector.jdbc.JDBCSingleIdentityConnectionFactory.createConnection(JDBCSingleIdentityConnectionFactory.java:114)
at com.metamatrix.data.pool.ConnectionPool.createConnection(ConnectionPool.java:372)
... 11 more
Caused by: java.sql.SQLException: General error
at com.metamatrix.common.util.exception.SQLExceptionUnroller.unRollException(SQLExceptionUnroller.java:63)
... 14 more
Exception in thread "main" java.lang.NullPointerException
at JDBCClient.execute(JDBCClient.java:87)
at JDBCClient.main(JDBCClient.java:42).....
Could you please suggest me where I am failing regarding this?
Thanks in advance for the help.
Thanks and Regards,
Dr.Prasad