Changing JAVA Oracle connection to MS SQL
Need some help.....
Below is what I currently have that's written in JAVA to connect to
Oracle, but I need to change it to connect to MS SQL.
===========
private void dbInit()
{
dbUrl = "jdbc:oracle:thin:@" + paramServerIP + ":3500:" +
paramDbSID;
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
}
catch(Exception eDriver)
{
failedDialog("Driver failed!", eDriver.getMessage());
}
}
private void dbOpen()
{
if(paramServerIP.indexOf("datadev") >= 0)
dbPswd = "test_pass";
else
dbPswd = "web_pass";
try
{
dbCon = DriverManager.getConnection(dbUrl, paramDbUserStr,
dbPswd);
dbStmt = dbCon.createStatement();
dbStmt.setEscapeProcessing(true);
}
catch(Exception eDbOpen)
{
failedDialog("Failed to open db connection!",
eDbOpen.getMessage());
}
}
private void dbClose()
{
try
{
dbStmt.close();
dbCon.close();
}
catch(Exception eDbClose)
{
failedDialog("Failed to close db connection!",
eDbClose.getMessage());
}
}
=========
Can someone tell what what I need to change? I need to change it to
connect a Database named datadev on a MS SQL 2000 server. Where do I
put the below info?
"jdbc:odbc:DRIVER={SQL
Server};Database="DATADEV";Server=VS032.INTERNAL.COM:3553;",
"web_user", "password"
Here's info that might be more clear then the above:
Server: VS032.INTERNAL.COM
Port: 3553
Database: DATADEV
User ID: web_user
Password: password
Sorry to ask, but I'm not a JAVA developer and was tasked to move a
web page from a UNIX platform to a Windows setup.