Home » Other » General » Java oracle connection
icon8.gif  Java oracle connection [message #136764] Sat, 10 September 2005 00:02 Go to next message
sandeepkumar99
Messages: 3
Registered: September 2005
Location: Ernakulam
Junior Member
I have wrriten a java prgrammme in JBuilder and I want to connect the front end of java with oracle as back end please reply as soon as possible.
Re: Java oracle connection [message #136770 is a reply to message #136764] Sat, 10 September 2005 01:19 Go to previous messageGo to next message
tarundua
Messages: 1080
Registered: June 2005
Location: India
Senior Member


I m not a java guy so dnt know exactly but as i know u can use JDBC-ODBC to make connection with Oracle.

regards,
tarun
Re: Java oracle connection [message #136966 is a reply to message #136764] Mon, 12 September 2005 08:42 Go to previous messageGo to next message
Einstein2
Messages: 3
Registered: September 2005
Junior Member
Use google ... and search for "Oracle Thin driver" ...
Re: Java oracle connection [message #137752 is a reply to message #136966] Fri, 16 September 2005 09:51 Go to previous message
bpeasey
Messages: 46
Registered: March 2005
Member
I played with this last month and got a result set back.
import java.sql.*;
class dbAccess {
  public static void main (String args []) throws SQLException {
    try {
      Class.forName ("oracle.jdbc.driver.OracleDriver");
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    }

    Connection conn = DriverManager.getConnection
                      ("jdbc:oracle:thin:@localhost:1521:orcl", "scott", "tiger");


    Statement stmt = conn.createStatement();
    ResultSet rset = stmt.executeQuery("select * from emp");
    while (rset.next())
      System.out.println (rset.getString(2) + " " + rset.getString(3));
    stmt.close();
  }
}

Best Regards,
Brian Peasey
http://oracle-exam-study-groups.com
Previous Topic: Temporal Database implementation.
Next Topic: email
Goto Forum:
  


Current Time: Sat Nov 23 02:42:06 CST 2024