Connecting to SQL Server 2000 with JDBC: A Practical Example
Classified in Computers
Written on in
English with a size of 5.03 KB
Connecting Through JDBC Driver for Microsoft SQL Server 2000
Exercise 2
import java.sql.*;
Class Home
public class Jdbc_sqls3 {
private Connection con = null;
Constants for PLS USE chain link
private final String url = "jdbc:microsoft:sqlserver://";
private final String server = "localhost";
private final String port = "1433";
private final String db = "pubsSQL";
private final String user = "sa";
private final String pass = "spark";
The password is easily found; it is recommended to request the user for the final application.
Make the driver use cursor on the server side, allowing more than one active SQL statement per connection.
private final String method = "cursor";
Main Method of Entry Program
public static void main(String[] args) throws Exception {
Jdbc_