MS SQL数据库的数据库连接问题:来自JSP的JDBC-ODBC驱动程序 [英] Database Connection Problem with MS SQL Database: JDBC-ODBC Driver from JSP

查看:98
本文介绍了MS SQL数据库的数据库连接问题:来自JSP的JDBC-ODBC驱动程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Netbeans 6.8使用JSP开发应用程序.我可以在我的项目指南系统中正确使用它.但是我无法从我的系统获得与数据库的连接.

I'm using Netbeans 6.8 to develop application using JSP. I'm able to work with it properly in my project guides system. But i'm unable to get the connection to database from my system.

它显示错误unable to connect.

我没有更改任何代码.如何解决此错误?

I have not changed any of the codes. How can I fix this error?

推荐答案

这可能有以下一种或多种原因:

This can have one or more of the following causes:

  1. JDBC URL中的IP地址或主机名错误.
  2. 本地DNS服务器无法识别JDBC URL中的主机名.
  3. JDBC URL中的端口号丢失或错误.
  4. 数据库服务器已关闭.
  5. 数据库服务器不接受TCP/IP连接.
  6. 数据库服务器已用尽连接.
  7. Java和DB之间的某些情况阻止了连接,例如防火墙或代理.

要解决一个问题,请遵循以下建议:

To solve the one or the other, follow the following advices:

  1. 使用ping进行验证和测试.
  2. 刷新DNS服务器或在JDBC URL中使用IP地址代替.
  3. 在数据库配置中验证它.
  4. 启动数据库.
  5. 在数据库配置中验证它.
  6. 重新启动数据库,并相应地修复代码,使其关闭finally中的连接.
  7. 禁用防火墙和/或配置防火墙/代理以允许/转发端口.
  1. Verify and test it using ping.
  2. Refresh DNS server or use IP address instead in JDBC URL.
  3. Verify it in the DB configuration.
  4. Start the DB.
  5. Verify it in the DB configuration.
  6. Restart the DB and fix your code accordingly that it closes connections in finally.
  7. Disable firewall and/or configure firewall/proxy to allow/forward the port.

也就是说,对于SQL Server,JDBC-ODBC桥驱动程序是可怜的选择.而是使用其自己的JDBC驱动程序或性能更强大的 jTDS驱动程序.

That said, the JDBC-ODBC bridge driver is a poor choice for SQL Server. Rather use its own JDBC driver or the much more performant and robust jTDS driver.

这篇关于MS SQL数据库的数据库连接问题:来自JSP的JDBC-ODBC驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆