Tuesday, 4 August 2015

Establish a connection with Sqlserver using Jdbc


Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");  // load the driver

Connection con = DriverManager.getConnection("jdbc:sqlserver://localhost:1433;databaseName=Movie;user=sa;pass word=City05;");   

Note :

Before establishing a connection from server using jdbc first download a specific driver , in this context we downloaded "Sqljdbc4.jar". after download add this file in your project under Lib directory,

No comments:

Post a Comment