Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Java: steps to connect to Oracle database

Java: steps to connect to Oracle database

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class OracleConnection
  public static Connection getOracleConnection() throws Exception
    String driver = "oracle.jdbc.driver.OracleDriver";
    String url = "jdbc:oracle:thin:@localhost:1521:DataBaseName";
    String username = "myUsername";
    String password = "myPassword";
    Class.forName(driver); // optional
    Connection conn = DriverManager.getConnection(url, username, password);
    return conn;

Users who found this page were searching for:

  • how to connect to java with oracle
  • java messageformat biginteger hexadecimal
  • read binary file python
  • python remove variable from tuble
  • move files between servers without password in python
  • java attributedstring examples
  • java collections.binarysearch generics arraylist
  • java scriptenginemanager js file from package directory
  • java prgram to connect java with oracle using sqljdbc
  • read given line from file python

No comments yet.

Leave a Comment