JDBC 4.2 SQL Server Driver 發布

jopen 9年前發布 | 23K 次閱讀 JDBC

JDBC 4.2 SQL Server Driver 發布

Microsoft has released the Community Technology Preview (CTP) of the Microsoft JDBC 4.2 Driver for SQL Server. According to official sources, the driver providers robust data access to Microsoft SQL Server and Microsoft Azure SQL Database for Java-based applications. It includes support for Java Development Kit (JDK) version 1.8.

Microsoft has updated XA Transaction feature which includes new timeout options for automatic rollback of unprepared transactions. Moreover, the new SQLServerBulkCopy class enables developers to quickly copy large amounts of data into tables or views in SQL Server and Azure SQL Database databases from other databases.

JDBC 4.2 SQL Server Driver 發布

In order to use the SQLServerBulkCopy class, you need to follow the following steps

  • Connect to the source
  • Connect to the destination SQL Server or Azure SQL Database
  • Create the SQLServerBulkCopy object
  • Call WriteToServer
  • </ul>

    The SQL Server Team has published a sample code on the official blog which examines the usage of the new class.

    // Obtain data from the source by connecting and loading it into a ResultSet
    Connection sourceConnection = DriverManager.getConnection(connectionUrl);
    String SQL = "SELECT * FROM SourceTable";
    Statement stmt = sourceConnection.createStatement();
    ResultSet resultSet = stmt.executeQuery(SQL);
    // Prepare for SQL Bulk Copy Operation
    Connection destConnection = DriverManager.getConnection(connectionUrl);

    The JDBC driver is part of the Microsoft Data Platform’s wider interoperability program with drivers for PHP 5.6, Node.js, JDBC, ODBC and ADO.NET.

    Microsoft has invited developers to test drive Microsoft Data Platform via a trial of Microsoft Azure SQL Database or by making use of SQL Server 2016 CTP.


    來自:http://less2css.com/blog/2015/07/13/jdbc-4-2-sql-server-driver/?ref=dzone

     本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
     轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
     本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!