package com;
import java.sql.*;
public class ConnDB {
// public String Dbdriver=\"com.microsoft.jdbc.sqlserver.SQLServerDriver\";
public Connection DBconn(String ServerName,String DBName,String User,String Pwd){
Connection conn=null;
try{
Class.forName(\"com.microsoft.jdbc.sqlserver.SQLServerDriver\").newInstance();
String url=\"jdbc:microsoft:sqlserver://\"+ServerName+\":1433;DatabaseName=\"+DBName;
conn=DriverManager.getConnection(url,User,Pwd);
return conn;
}
catch(Exception ee)
{
System.out.print(ee.toString());
return conn;
}
}
}