来自Websphere Application Server的java连接池对象
我正在尝试使用WebSphereApplicationServer8.5中的连接池对象和Derby数据库连接到我的数据源。 这是我在我的EnterpriseJAVE项目中写的TestCode。 但我得到了以下提到的例外:
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)
我已经在WebSphereApplicationServer中创建了一个数据源,连接工作正常
使用DriverManager连接到数据源工作正常。然而,与上下文(在上面的共享代码中)建立了连接,但它表示模式不存在。jndi名称似乎是空的。WAS或Java项目中是否有任何设置需要更改或添加
从一个星期以来,我一直在努力解决这个问题。期待帮助。 提前谢谢
# 1 楼答案
问题是jar文件(com.ibm.we.admin.client…)他失踪了。 还有两个derby数据库实例正在运行。 谢谢!
# 2 楼答案
您的数据库中是否有使用该名称的模式?见http://db.apache.org/derby/faq.html#schema_exist