I am trying to connect to my data source using Connection pool objects in Websphere Application Server 8.5 and using Derby database. Here is the TestCode that I have written in my Enterprise Jave Project. But I am getting the below mentioned exception:
java.sql.SQLSyntaxErrorException: Schema 'TESTCONN' does not exist 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.executeQuery(Unknown Source) at org.apache.derby.iapi.jdbc.BrokeredStatement.executeQuery(Unknown Source) at com.ibm.ws.rsadapter.jdbc.WSJdbcStatement.executeQuery(WSJdbcStatement.java:1017) at dbConnect.TestClass.select(TestClass.java:43) at dbConnect.TestClass.main(TestClass.java:19)
I have created a data source in Websphere application server and connection is working fine.
Connecting to data source using DriverManager works fine. However with Context (in the above shared code) connection is established but it says Schema does not exist. It seems jndi name is empty. Are there any settings in WAS or in Java Project that needs to be changed or added?
I am struggling with this problem since one week. Looking forward for help. Thanks in advance.