mysql开发出来的程序到SQLserver为啥连接都连不上

javadown 2006-11-22 03:41:22
Spring+Hibernate+Struts开发的程序 数据库Mysql5.0 现在要转到SQLServer2000己打sp4但c3p0提示数据库连不上

MySQL配置文件

datasource.driverClassName=org.gjt.mm.mysql.Driver
datasource.url=jdbc:mysql://localhost:3306/sy_user?useUnicode=true&characterEncoding=GBK
datasource.username=root
datasource.password=root

datasource.maxActive=10
datasource.maxIdle=2
datasource.maxWait=120000
datasource.whenExhaustedAction=1
datasource.validationQuery=select 1 from dual
datasource.testOnBorrow=true
datasource.testOnReturn=false

c3p0.acquireIncrement=3
c3p0.idleConnectionTestPeriod=3600
c3p0.minPoolSize=9
c3p0.maxPoolSize=1000
c3p0.maxStatements=100000
c3p0.numHelperThreads=10
c3p0.maxIdleTime=600

hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
#hibernate.dialect=org.hibernate.dialect.MySQLMyISAMDialect
#hibernate.dialect=org.hibernate.dialect.MySQLDialect
hibernate.jdbc.batch_size=25
hibernate.jdbc.fetch_size=50
hibernate.show_sql=true
hibernate.hbm2ddl.auto=create-drop

SQLSERVer配置文件
datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
datasource.url=jdbc:microsoft:sqlserver://localhost:1433;databaseName=sy_User
datasource.username=sy_movie
datasource.password=movie

datasource.maxActive=10
datasource.maxIdle=2
datasource.maxWait=1200
datasource.whenExhaustedAction=1
datasource.validationQuery=select 1 from dual
datasource.testOnBorrow=true
datasource.testOnReturn=false

c3p0.acquireIncrement=3
c3p0.idleConnectionTestPeriod=360
c3p0.minPoolSize=5
c3p0.maxPoolSize=100
c3p0.maxStatements=0
c3p0.numHelperThreads=10
c3p0.maxIdleTime=600

#hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
#hibernate.dialect=org.hibernate.dialect.MySQLMyISAMDialect
hibernate.dialect=org.hibernate.dialect.SQLServerDialect
hibernate.jdbc.batch_size=25
hibernate.jdbc.fetch_size=50
hibernate.show_sql=true
hibernate.hbm2ddl.auto=create-drop

SQLServer连接的用户名密码保证好用,我用查询分析器试了

系统日志

2006-11-22 15:10:57,332 [resin-tcp-connection-*:81-2] [org.springframework.jdbc.datasource.JdbcTransactionObjectSupport] [INFO] - JDBC 3.0 Savepoint class is available
2006-11-22 15:11:26,348 [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1] [com.mchange.v2.resourcepool.BasicResourcePool] [WARN] - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@135ae7e -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30).
2006-11-22 15:11:26,348 [resin-tcp-connection-*:81-2] [org.hibernate.util.JDBCExceptionReporter] [WARN] - SQL Error: 0, SQLState: null
2006-11-22 15:11:26,348 [resin-tcp-connection-*:81-2] [org.hibernate.util.JDBCExceptionReporter] [ERROR] - Connections could not be acquired from the underlying database!
2006-11-22 15:11:26,348 [resin-tcp-connection-*:81-2] [org.hibernate.util.JDBCExceptionReporter] [WARN] - SQL Error: 0, SQLState: null
2006-11-22 15:11:26,348 [resin-tcp-connection-*:81-2] [org.hibernate.util.JDBCExceptionReporter] [ERROR] - Connections could not be acquired from the underlying database!
2006-11-22 15:11:26,379 [resin-tcp-connection-*:81-2] [org.apache.struts.action.RequestProcessor] [WARN] - Unhandled Exception thrown: class org.springframework.transaction.CannotCreateTransactionException
服务器是Resin3.0.14
...全文
353 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
sxtbuaa 2006-11-28
  • 打赏
  • 举报
回复
sql server需要打到sp3
hackangcn 2006-11-27
  • 打赏
  • 举报
回复
datasource.url=jdbc:mysql://localhost:3306/sy_user?useUnicode=true&characterEncoding=GBK

把 & 换成 &
javadown 2006-11-27
  • 打赏
  • 举报
回复
在服务器中的,保证没有问题的,以前的程序都好用
qnjian 2006-11-24
  • 打赏
  • 举报
回复
到Sql Server的登录验证方式设置中看一看,你是否设置为只允许Window 方式验证,如是,请改为两者结合(Sql server用户验证)的那种验证,或改另一种,试下看能否解决!

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧