Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.*;
- public class SqlConn {
- public Connection getcon()
- {
- Connection Conn = null;
- try {
- Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
- Conn=DriverManager.getConnection("jdbc:microsoft:sqlserver://HASNAINRAZA-LAP:1433;databaseName=SMS;user=sa;password=31121990");
- } catch (ClassNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (SQLException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return Conn;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement