Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2007

Tip: Looking for answers? Try searching our database.

Changing JAVA Oracle connection to MS SQL

Thread view: 
crab.dae@gmail.com - 20 Aug 2007 20:45 GMT
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.
Manish Pandit - 20 Aug 2007 21:24 GMT
> Need some help.....
>
> 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.

I've responded this question on another thread that you started on
8/17.

-cheers,
Manish


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.