Advertisement
gagan93

JDBC check for MyCampusNotes.com

Jul 22nd, 2014
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | None | 0 0
  1. import java.sql.*;
  2.  
  3. public class Test
  4. {
  5.    public static void main(String[] args)
  6.    {
  7.       try
  8.       {
  9.          Class.forName( "com.microsoft.sqlserver.jdbc.SQLServerDriver" );
  10.          System.out.println("no error till here"); 
  11.          Connection c = DriverManager.getConnection("jdbc:sqlserver://localhost:1433;databaseName=;integratedSecurity=true;","", "");;
  12.          System.out.println( "Connected with "+c);     
  13.       }
  14.       catch( Exception ex )
  15.       {
  16.          ex.printStackTrace();
  17.       }
  18.    }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement