SQLServer ----- use jTDS to connect to the SQLServer database, sqlserver ----- jtds
1. Introduction to jTDS
JTDS is an open-source JDBC3.0 driver implemented in Java 100%. It is used to connect Microsoft SQL Server (6.5, 2012,) and Sybase (10, 11, 12, 15)
JTDS is based on freeTDS and is the fastest JDBC driver for enterprise-level SQL Server and Sybase.
JTDS is fully compatible with JDBC3.0. It supports only forward and scrollable/updatable result sets, and supports completely independent parallel Statements, in addition, the methods of Database MetaData and ResultSet MetaData are implemented.
Ii. Download jTDS
Maven pom file Configuration:
<dependency><groupId>net.sourceforge.jtds</groupId><artifactId>jtds</artifactId><version>1.2.4</version></dependency>
You only need to put the JAR file in the classpath path.
3. Use jTDS to connect to the SQLServer Database
(1) default database instance
Database URL: 1) jdbc: jtds: sqlserver: // localhost: 1433; DatabaseName = iems
2) jdbc: jtds: sqlserver :/// localhost: 1433/iems
(2) non-default database instance
Database URL: 1) jdbc: jtds: sqlserver: // localhost: 1433; DatabaseName = iems; instance = MySQLServer (non-recognized instance name)
2) jdbc: jtds: sqlserver: // localhost: 1433/iems; instance = MySQLServer (non-default instance name)
Driver Class: net. sourceforge. jtds. jdbc. Driver