This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

New to jdbc,please help

 
Metelda Ganugapanta
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am new to jdbc. I have Orale9.2.0.1 and jdk1.4.0 installed on my Windows XP machine.
I want to install a driver from the following website.
http://otn.oracle.com/software/tech/java/sqlj_jdbc/htdocs/jdbc9201.html
There are 3 files to be downloaded.
ojdbc14.jar
ojdbc14_g.jar
ocrs12.zip.
I have not downloaded them yet.
Am I doing correctly?
Is this a java Thin Driver that I am downloading ?
Is this JDBC2.0 or JDBC3.0 ?How would I know ?
Thanks
Metelda
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the link you provided

all of the following are THIN drivers:
For use with JDK 1.4 (JDBC 3.0 compatible)
ojdbc14.jar - JDBC classes (1,181,679 bytes) - all JDBC 3.0 spec classes - this is generally the one you need
ojdbc14_g.jar - JDBC classes with debug and trace(1,391,860 bytes) - all JDBC 3.0 spec classes and some extra utilities
ocrs12.zip - Additional RowSet support (36,764 bytes) - separate RowSet Implementation - don't need it
For use with JDK 1.2 and JDK 1.3 (JDBC 2.0 compatible)
classes12.zip - JDBC classes (1,213,897 bytes) - all JDBC 2.0 spec classes - this is generally the one you need if you want JDBC 2.0 implementation
classes12_g.zip - JDBC classes with debug and trace (1,451,562 bytes) - all JDBC 2.0 spec classes and some extra utilities
classes12dms.jar - JDBC classes for use with Enterprise Manager (1,208,920 bytes)
classes12dms_g.jar - JDBC classes for use with EM and with debug and trace (1,446,753 bytes)
ocrs12.zip - Additional RowSet support (36,764 bytes)
nls_charset12.zip - Additional National Language character set support (1,813,731 bytes)
The skinny:
at this point all you should need is ojdbc14.jar
Jamie
[ October 30, 2003: Message edited by: Jamie Robertson ]
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
another link you might need is Oracle9i JDBC Developer's Guide and Reference
 
Metelda Ganugapanta
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Jamie
Thanks very much for your reply.
So,all I have to download is "ojdbc14.jar" .
Thanks for the additional link you provided.
Metelda
 
Metelda Ganugapanta
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
I have followed the above link "Oracle 9i JDBC Developer's Guide and Reference "
I have not downloaded the file "ojdbc14.jar" since it is already in the
"oracle9201\jdbc\lib".
Now I am trying to find out the DriverVersion.
I am compiling this file
import java.sql.*;
import oracle.jdbc.driver .*;
class JDBCVersion
{
public static void main (String args[])
throws SQLException
{
// Load the Oracle JDBC driver
DriverManager.registerDriver
(new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection
("jdbc racle:thin:@localhost:2030:mary","scott","tiger");
// Create Oracle DatabaseMetaData object
DatabaseMetaData meta = conn.getMetaData();
// gets driver info:
System.out.println("JDBC driver version is"+ meta.getDriverVersion());
I am getting an error
package "oracle.jdbc.driver.*;" does not exist.
Also I am not sure about the port number and SID.That was the number I noted down when I downloaded Oracle.
Can anyboby please help me ?
Thanks
Metelda
 
Joe Ess
Bartender
Posts: 9256
9
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Metelda Ganugapanta:

package "oracle.jdbc.driver.*;" does not exist.

Do you have the ojdbc jar file in your classpath?

Also I am not sure about the port number and SID.That was the number I noted down when I downloaded Oracle.

I think the default port number for Oracle is 1521. Of course, your installation may vary.
As for SID, you configure that when you set up the database (should be at the same time you specified a database name).
 
Metelda Ganugapanta
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Joe
Thanks for your help.
I have set the classpath and changed the port number too.
It is working now.
Metelda
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic