Link to home
Start Free TrialLog in
Avatar of heng03
heng03

asked on

Connect to Oracle DB

Hi

I want to connect to a Oracle Db.

Below is an example for connect to a MS Access.
Pls give sample code for connect to Oracle DB.

            try{
                  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");      
            }
            catch(ClassNotFoundException e)      
            {
                  System.out.println(e);
                  return;            // to exit program on exception
            }            
      }


            try
            {
                  //Can be improved by using connection pooling
                  Connection con=DriverManager.getConnection("jdbc:odbc:Highway");
                  Statement stmt = con.createStatement();
} catch(SQLException e)
            {
                  System.out.println("Encountered problem adding question. "+e);
            }


Thanks & Rgds
Heng03

ASKER CERTIFIED SOLUTION
Avatar of girionis
girionis
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial