MSSQL2000与MSSQL2005 JDBC URL的区别


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

String driverName = com.microsoft.jdbc.sqlserver.SQLServerDriver;

String dbURL = jdbcmicrosoftsqlserverlocalhost1433; DatabaseName=sample;


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

String driverName = com.microsoft.sqlserver.jdbc.SQLServerDriver;

String dbURL = jdbcsqlserverlocalhost1433; DatabaseName=sample;


如果数据库有实例名称(例如MSSQL2K),URL的写法如下:

2000中:

jdbcmicrosoftsqlserverlocalhostMSSQL2K1433; DatabaseName=sample

2005中:

jdbcsqlserverlocalhostMSSQL2K1433; DatabaseName=sample