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
{filelink=7095}

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:

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

No comments yet.

Leave a Comment