出错了:Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0" java.lang.UnsatisfiedLinkError: no ocijdbc10 in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at oracle.jdbc.driver.T2CConnection$1.run(T2CConnection.java:3147)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.jdbc.driver.T2CConnection.loadNativeLibrary(T2CConnection.java:3143)
at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:221)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:441)
at oracle.jdbc.driver.T2CConnection.<init>(T2CConnection.java:132)
at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:78)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
。。。。。。。
出错了:org.springframework.jdbc.BadSqlGrammarException: SqlMapClient operation; bad SQL grammar []; nested exception is com.ibatis.co
mmon.jdbc.exception.NestedSQLException:
--- The error occurred in com/eshore/idep/schedule/dao/po/ThreadControl.xml.
--- The error occurred while applying a parameter map.
--- Check the selectThreadControl-InlineParameterMap.
--- Check the statement (query failed).
--- Cause: java.sql.SQLException: ORA-00932: inconsistent datatypes: expected %s got %s
。。。。。。。
为什么?怎么解决?请继续...
声明:下面的问题以ORACLE10g为参考版本(同样适用于ORACLE11g),因为在ORACLE9i中基本上是不会出现这些信息的,只要我们遵照通用的原则(自行google吧),但我们若以此文为参考,完全适应!
插序:关于JDBC Driver for ORACLE详细信息可参考http://redsnow-fenglin.iteye.com/blog/520618,我们常用的驱动应该的应该是第3、4类和第2类的OCI,据传OCI的性能优于THIN,但并未看到有力的证明,而且经个人测试也未必如此,参见我的帖子:
其实,开发中最常见的就是ORACLE的THIN模式,但为何我这里提出这个OCI模式呢?这是因为经过多方查资料显示在使用ORACLE的RAC模式时,推荐OCI模式~~
其实OCI模式使用起来配置也是蛮简单的,但可能种种原因,我们会遇到种种预期不到的问题,这里我给出一些注意事项:
解决之道:
按照上面的4点,ORACLE OCI模式无忧矣。
导致两个异常的元凶:
A.解决之道4中没用-Djava.library.path强制导入我们ORACLE相应的这个动态库(在IBM AIX5.3) 引起异常
java.lang.UnsatisfiedLinkError: no ocijdbc10 in java.library.path
B.解决之道4中没有保持版本一致的JDBC DRIVER及相应的OCI所需本地动态库引起异常
java.sql.SQLException: ORA-00932: inconsistent datatypes
问题已解决,希望对同僚们有所帮助~~