Home > Database > Mysql Tutorial > jtds连接sqlserver2008

jtds连接sqlserver2008

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 15:18:01
Original
1886 people have browsed it

JTDS是一个开放源代码的100%纯Java的,用于JDBC 3.0驱动Microsoft SQL Server 和Sybase(10 ,11 ,12 ,15 版本)的驱动程序 。 JTDS是基于freetds的,并且是目前最快的生产准备JDBC驱动程序为SQL Server和Sybase 。 JTDS完全与JDBC 3.0兼容,支持只向前的

JTDS是一个开放源代码的100%纯Java的,用于JDBC 3.0驱动Microsoft SQL Server 和Sybase(10 ,11 ,12 ,15 版本)的驱动程序 。 JTDS是基于freetds的,并且是目前最快的生产准备JDBC驱动程序为SQL Server和Sybase 。

JTDS完全与JDBC 3.0兼容,支持只向前的,和可滚动/可更新的结果集(ResultSets)中并行(完全独立)语句,并且可实施所有databasemetadata和resultsetmetadata方法。

jTDS - SQL Server and Sybase JDBC driver

 

package sqlserver_jtds;

import java.sql.*;

public class SQLServer {
 String dbURL = "jdbc:jtds:sqlserver://127.0.0.1:1433;;DatabaseName=test";
 String user = "sa";
 String password = "123456";
 
 Connection conn;
 
 public SQLServer(){
  this.connect();
 }
 public void connect(){
  try{
   try{
    Class.forName("net.sourceforge.jtds.jdbc.Driver");
   }catch(Exception e){
    e.printStackTrace();
   }
   //DriverManager.registerDriver(new net.sourceforge.jtds.jdbc.Driver());
   conn = DriverManager.getConnection(dbURL,user,password);
   DatabaseMetaData metaData = conn.getMetaData();
   
   System.out.print(metaData.getDatabaseProductVersion());
  }catch(Exception e){
   e.printStackTrace();
  }
 }
 public static void main(String[] args){
  new SQLServer();
 }
}

Copy after login


 

jtds下载地址:http://sourceforge.net/projects/jtds/files/latest/download
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template