码迷,mamicode.com
首页 > 数据库 > 详细

关于数据库连接的一个错误:Communications link failure

时间:2017-04-18 11:10:28      阅读:2560      评论:0      收藏:0      [点我收藏+]

标签:nbsp   init   数据库连接   show   password   rom   ica   strong   cti   

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

很容易看出是数据库出了问题,看看是否是db.properties文件中路径错误

各数据库连接数据库中db.properties中的写法:

SQLServer 2000 连接数据库

driverClassName=com.microsoft.jdbc.sqlserver.SQLServerDriver

url=jdbc:microsoft:sqlserver://127.0.0.1:1433;databaseName=mytestdb

username=robinliu

password=robinliu

initialSize =2

maxActive=2

maxWait=2000

 

mySql 连接数据库

driverClassName=com.mysql.jdbc.Driver

url=jdbc:mysql://localhost:3306/test

username=root

password=mysql

initialSize=4

maxActive =10

 

SQLServer 2005 连接数据库

driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver

url=jdbc:sqlserver://127.0.0.1:1433;databaseName=stuinfo

username=sa

password=1234

initialSize =2

maxActive=100

maxWait=2000

 

oracle数据库 连接数据库

 

database.database=ORACLE

database.driverClassName = oracle.jdbc.driver.OracleDriver

database.password        = sinple

database.show_sql        = true

 

database.url = jdbc\:oracle\:thin\:@localhost\:1521\:sinple

database.username        = sinple

关于数据库连接的一个错误:Communications link failure

标签:nbsp   init   数据库连接   show   password   rom   ica   strong   cti   

原文地址:http://www.cnblogs.com/tangling/p/6726705.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!