HIBERNATE 连接 SQLSERVER2005

2009-04-08 10:04:15,692 [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2] DEBUG (BasicResourcePool.java:1831) - An exception occurred while acquiring a poolable resource. Will retry.
java.sql.SQLException: No suitable driver
 at java.sql.DriverManager.getDriver(DriverManager.java:264)
 at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:224)
 at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:135)
 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)

。。。。。。。。。。。。

 

 

在SQL Server 2000 中加载驱动和URL路径的语句是

String driverName = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
String dbURL = "jdbc:microsoft:sqlserver://localhost:1433; DatabaseName=sample";

而SQL Server 2005 中加载驱动和url的语句则为

String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
String dbURL = "jdbc:sqlserver://localhost:1433; DatabaseName=sample";

可以看出版本不同连接方法也是不同的。SQL Server有许多不同版本,看你用的是哪个了。

 

注意!

你可能感兴趣的:(java,sql,Hibernate,SQL Server,jdbc)