Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Q: Connect with JDBC

Q: Connect with JDBC

From: Schauder <Jens.Schauder_at_opal-edv.com>
Date: Fri, 17 Apr 1998 13:41:19 +0200
Message-ID: <892813071.892577@demdwu29>


Has anybody done a connect to Oracle8 (or anything else). If got some serious problems with it and would appriciate some help on this topic.

My application looks like this:

import java.sql.*;
public class HelloWorld{
 public static void main(String[] args){   Connection lo_OracleConnection;
  System.out.println("Hello World!");
  try{
   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
} catch(java.lang.ClassNotFoundException e) {
   System.err.print("ClassNotFoundException: ");    System.err.println(e.getMessage());
}

  System.out.println("Hello Driver!");
  String lsURL = "jdbc:odbc:TEST01";
  String lsUser = "scott";

  String lsPassword = "tiger";
  System.out.println("Hello " + lsURL);
  System.out.println("Hello " + lsUser);
  System.out.println("Hello " + lsPassword);
  try{
   lo_OracleConnection = DriverManager.getConnection(lsURL,"scott","tiger");    System.out.println("Hello Oracle!");
} catch(SQLException ex){

   System.err.println("SQLException: " + ex.getMessage());
}

  System.out.println("Bye Oracle!");
 }
}

And produces this output:

Hello World!
Hello Driver!
Hello jdbc:odbc:TEST01
Hello scott
Hello tiger
SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no
 default driver specified
Bye Oracle!

I use the ODBC driver from Oracle,
the JDBC Bridgedriver shipped with jdk1.1.5

Thanks for the help.

Jens.Schauder_at_opal-edv.com Received on Fri Apr 17 1998 - 06:41:19 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US