Re: JDBC setup on windows xp! Please help
Date: 21 Jan 2002 03:56:52 -0800
Message-ID: <59dd274f.0201210356.74ff3342_at_posting.google.com>
"Samir N. Thacker" <samirthacker_at_rogers.com> wrote in message news:<AWu28.2417$%G.705_at_news2.bloor.is>...
> Hi!
>
> I am new to JDBC and so having problems setting up JDBC correctly on my
> machine. I have Windows XP Pro OS, Java SDK version 1.3.1_01 and Oracle
> 8.1.7 for Windows NT and I want to write Java applications to connect to
> oracle databases.
>
> I don't know how to set up JDBC for Oracle on Windows XP machine. I tried
> different approaches but i always ended up with an error message as below...
>
> "C:\Employee.java:17: cannot resolve symbol
> symbol : class OracleDriver
> location: package driver
> DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
>
> ^
> 1 error"
>
> From whatever I have read i believe that it's got something to do with
> classes12.zip file which is in my C:\orant\ora8i\jdbc\lib folder on my hard
> drive.
>
> Can someone please provide me with a step-by-step instruction on how to set
> up JDBC correctly and show me what exactly I am supposed to do in Windows XP
> Pro to set up the environment variable values and whatever else is required
> to use the Thin drivers from Oracle. I have visited Oracle's site and Sun's
> website to find answers but they mention nothing about setting up JDBC on a
> Windows XP machine!!
>
> thanks a lot in advance...
>
> samir
- The classes12.zip file has to be included in your CLASSPATH (include the zip file name too, not just the directory in which it exists).
- You should import the Oracle JDBC package in your source file. Alternately, you can dynamically load the driver:
Class.forName("oracle.jdbc.driver.JdbcDriver") ;
3. The database connection is established as below:
Connection cn = DriverManager.getConnection(<URL string>,<user>,<passwd>) ;
I don't remember the exact sytax of the URL string, but it should contain the IP address/host name of the Oracle server, the Instance identifier and the port number of the listener process at the server.
Hope this helps,
Rajesh Received on Mon Jan 21 2002 - 12:56:52 CET