SQL Server 2005 Driver for JDBC

  1. Load the SQL Server 2005 Driver for JDBC before you load the SQL Server 2000 Driver for JDBC. To do this, use the DriverManager class as in the following code example.
    Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); // 2005 version
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"); // 2000 version
    
  2. Use a SQL Server 2005 Driver for JDBC connection URL to establish a connection. To do this, use code that resembles the following code example.
    Connection con = DriverManager.getConnection("jdbc:sqlserver://<ServerName>;user=<UserName>;password=<Password>");

For more information about how to connect with data sources and how to use a connection URL, visit the following Microsoft Developer Network (MSDN) Web sites:

Building the connection URL
http://msdn2.microsoft.com/en-us/library/ms378428.aspx (http://msdn2.microsoft.com/en-us/library/ms378428.aspx)

Setting the connection properties
http://msdn2.microsoft.com/en-us/library/ms378988.aspx (http://msdn2.microsoft.com/en-us/library/ms378988.aspx)


The SQL Server 2000 JDBC driver accepts connection URLs from the SQL Server 2005 JDBC Driver. The SQL Server 2005 JDBC Driver connection string URLs start with the following string:
jdbc:sqlserver:// ConnectionString
The SQL Server 2000 Driver for JDBC should only accept connection string URLs that start with the following string:
jdbc:microsoft:sqlserver:// ConnectionString
However, the SQL Server 2000 Driver for JDBC also accepts connections that have the following format:
jdbc:sqlserver:// ConnectionString
The exception occurs because the SQL Server 2000 Driver for JDBC is not designed to connect to a SQL Server 2005 database.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
SQL Server JDBC Driver 3.0是用于将Java应用程序与SQL Server数据库进行连接和交互的驱动程序。它是由Microsoft开发和维护的,具有许多强大的功能和特性。 首先,SQL Server JDBC Driver 3.0提供了高性能和高可靠性的数据库连接。它使用了最新的网络协议和优化算法,可以有效地管理和处理大量的数据库连接请求,保证了应用程序的稳定性和可靠性。 其次,SQL Server JDBC Driver 3.0支持各种数据库操作,包括查询、插入、更新和删除等。它提供了丰富的API和方法,可以轻松地执行各种SQL语句和操作,方便开发人员进行数据库操作。 此外,SQL Server JDBC Driver 3.0还支持事务处理和批量操作。它可以通过开启事务来确保数据库操作的一致性和完整性,同时还支持批量操作,可以一次性执行多个数据库操作,提高了数据库操作的效率和性能。 另外,SQL Server JDBC Driver 3.0还提供了连接池和连接重试等功能。连接池可以帮助开发人员管理数据库连接的创建和释放,减少了数据库连接的开销;连接重试机制可以自动重新连接数据库,以确保数据库连接的可靠性和稳定性。 最后,SQL Server JDBC Driver 3.0还提供了安全和加密机制。它支持各种认证和授权方式,可以保护数据库的安全性;同时还支持数据加密和传输加密,可以确保数据的机密性和完整性。 总之,SQL Server JDBC Driver 3.0是一个功能强大的驱动程序,提供了丰富的功能和特性,可以帮助开发人员轻松地连接和操作SQL Server数据库。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值