DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 4 of 4

Thread: JDBC and Oracle

Hybrid View

  1. #1
    Patrick Guest

    JDBC and Oracle


    Hello,

    I am trying to access Oracle 8I from java and I don't want to use ODBC to
    connect. What are the issues and which driver is best for this. I have heard
    that Oracles Thin Client is best. I am new to this. I did try to connect
    and got a message a saying "no suitable driver"

    Class.forName("oracle.jdbc.driver.OracleDriver");

    Any help is most appreciated.

    Patrick

  2. #2
    Rob Guest

    Re: JDBC and Oracle


    Hi Patrick,

    This is one way:

    // load the driver
    DriverManager.registerDriver(
    new oracle.jdbc.driver.OracleDriver());

    // create the connection
    Connection conn =
    DriverManager.getConnection (
    "jdbcracle:thin:db-new.gsi.de:1521:hadp",
    "scott", "tiger");

    You need to have the JDBC Drivers in your CLASSPATH
    e.g. /path/to/classes111.zip
    have you got this in your CLASSPATH ??

    You may find this site very useful:

    http://www-wnt.gsi.de/oragsi/

    BTW I'm also very new to oracle/JDBC but I thought this might help

    Rob

    "Patrick" <programwiz@aol.com> wrote:
    >
    >Hello,
    >
    >I am trying to access Oracle 8I from java and I don't want to use ODBC to
    >connect. What are the issues and which driver is best for this. I have heard
    >that Oracles Thin Client is best. I am new to this. I did try to connect
    >and got a message a saying "no suitable driver"
    >
    > Class.forName("oracle.jdbc.driver.OracleDriver");
    >
    >Any help is most appreciated.
    >
    >Patrick



  3. #3
    Giri Guest

    Re: JDBC and Oracle


    Hi Patrick

    Few more additions to what u have written. the correct syntax for the Create
    connection part is

    default port for thin is 1521. so u can use this
    Connection conn =
    DriverManager.getConnection (
    "jdbcracle:thin:@<server_name>:1521:<database service name at the
    DB server>",
    "scott", "tiger");

    The CLASPATH setting is right. but, in case u want a driver which supports
    JDBC2.0, then u have to get a zip file called classes12.zip from oracle site.

    the correct CLASSPATH setting is <oracle_home>\ora81(for 8i)\jdbc\lib\classes12.zip

    Thin driver is the best driver, in case u have no plans of changing the database
    to a different vendor or do not have different distributed databases(thin
    works only with Oracle), then thin is the best choice. But, in case u have
    different databases, then u can go for a driver called IDS driver which is
    a type3 driver.

    Hope this helps

    Giri


    "Rob" <robx@fsmail.net> wrote:
    >
    >Hi Patrick,
    >
    >This is one way:
    >
    > // load the driver
    > DriverManager.registerDriver(
    > new oracle.jdbc.driver.OracleDriver());
    >
    > // create the connection
    > Connection conn =
    > DriverManager.getConnection (
    > "jdbcracle:thin:db-new.gsi.de:1521:hadp",
    > "scott", "tiger");
    >
    >You need to have the JDBC Drivers in your CLASSPATH
    >e.g. /path/to/classes111.zip
    >have you got this in your CLASSPATH ??
    >
    >You may find this site very useful:
    >
    > http://www-wnt.gsi.de/oragsi/
    >
    >BTW I'm also very new to oracle/JDBC but I thought this might help
    >
    >Rob
    >
    >"Patrick" <programwiz@aol.com> wrote:
    >>
    >>Hello,
    >>
    >>I am trying to access Oracle 8I from java and I don't want to use ODBC

    to
    >>connect. What are the issues and which driver is best for this. I have

    heard
    >>that Oracles Thin Client is best. I am new to this. I did try to connect
    >>and got a message a saying "no suitable driver"
    >>
    >> Class.forName("oracle.jdbc.driver.OracleDriver");
    >>
    >>Any help is most appreciated.
    >>
    >>Patrick

    >



  4. #4
    Trung Le Ho Guest

    Re: JDBC and Oracle


    Hi Patrick,

    Let's try this:

    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

    Connection conn = DriverManager.getConnection("jdbcracle:thin:urlortNumber:instance);

    ....

    Le Ho




    "Patrick" <programwiz@aol.com> wrote:
    >
    >Hello,
    >
    >I am trying to access Oracle 8I from java and I don't want to use ODBC to
    >connect. What are the issues and which driver is best for this. I have heard
    >that Oracles Thin Client is best. I am new to this. I did try to connect
    >and got a message a saying "no suitable driver"
    >
    > Class.forName("oracle.jdbc.driver.OracleDriver");
    >
    >Any help is most appreciated.
    >
    >Patrick



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links