Examples of OracleDataSource


Examples of oracle.jdbc.pool.OracleDataSource

    try {
      // Load the properties file to get the connection information.
      Properties prop = TestSample.loadParams("Connection");

      // Create a OracleDataSource instance.
      OracleDataSource ods = new OracleDataSource();

      // Set the driver type.
      ods.setDriverType("thin");

      // Set the database server name.
      ods.setServerName((String)prop.get("HostName"));

      // Set the database name.
      ods.setDatabaseName((String)prop.get("SID"));

      // Set the port number.
      ods.setPortNumber(new Integer((String)prop.get("Port")).intValue());

      // Set the user name.
      ods.setUser((String)prop.get("UserName"));

      // Set the password.
      ods.setPassword((String)prop.get("Password"));

      // Create a connection  object.
      conn = ods.getConnection();

    } catch(SQLException ex) { // Trap SQL errors.
        System.out.println("Error in Connecting to the Database "+'\n'+
                           ex.toString());
    } catch(IOException ex) { // Trap IO errors.
View Full Code Here

Examples of oracle.jdbc.pool.OracleDataSource

   
    private void createConnection()
    {
        try
        {
            ods = new OracleDataSource();
            ods.setDriverType(drive);
            ods.setServerName(serverName);
            ods.setPortNumber(port);
            ods.setDatabaseName(databaseName);
            ods.setUser(username);
View Full Code Here

Examples of oracle.jdbc.pool.OracleDataSource

    }
   
    //Metodo di connesione
    public void Connessione(String username, String password) throws SQLException
    {
        ods = new OracleDataSource();                                           //Crea una nuova istanza di database
        ods.setDriverType(drive);                                               //Imposta il driver da utilizzare
        ods.setServerName(serverName);                                          //Imposta l'indirizzo di connessione
        ods.setPortNumber(port);                                                //Imposta la porta
        ods.setDatabaseName(databaseName);                                      //Imposta il nome del database
        ods.setUser(username);                                                  //Imposta l'username di connessione
View Full Code Here

Examples of oracle.jdbc.pool.OracleDataSource

    this.openConnection();
  }
 
  public void openConnection() throws DopeDBException {
    try {
      OracleDataSource dataSource = new OracleDataSource();
     
      dataSource.setUser(this.userName);
      dataSource.setPassword(this.password);
      dataSource.setDriverType(this.driverType);
      dataSource.setServerName(this.serverName);
      dataSource.setPortNumber(this.portNumber);
      dataSource.setDatabaseName(this.databaseName);
     
      this.conn = dataSource.getConnection();
     
      this.conn.createStatement().execute("alter session set NLS_DATE_FORMAT='DD-MM-YYYY HH24:MI:SS'");

      dataSource.close();
    } catch (SQLException e) {
      throw new DopeDBException(e, "Failed to created new OracleDataSource", "Kunne ikke forbinde til database.");
   
  }
View Full Code Here

Examples of oracle.jdbc.pool.OracleDataSource

  public String LogWho = "'"+System.getenv("COMPUTERNAME")+": "+System.getenv("USERNAME").toUpperCase()+"'";
  private int LogAnt = 0;

  public void Connect() throws SQLException {
      DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
    OracleDataSource ods = new OracleDataSource();
    ods.setUser("KS_DRIFT");
    ods.setPassword("KS_DRIFT");
    ods.setDriverType("thin");
    ods.setServerName("ORAAIXP2");
    ods.setPortNumber(1527);
    ods.setDatabaseName("CTIR");
    con = ods.getConnection();
    ods.close();
    db = con.createStatement();
    }
View Full Code Here

Examples of oracle.jdbc.pool.OracleDataSource

    db = con.createStatement();
    }
 
  public void ConnectKSAPP() throws SQLException {
      DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
    OracleDataSource ods = new OracleDataSource();
    ods.setUser("KS_APPLIKATION");
    ods.setPassword("APPLIKATION_4711");
    ods.setDriverType("thin");
    ods.setServerName("ORAAIXP2");
    ods.setPortNumber(1527);
    ods.setDatabaseName("CTIR");
    con = ods.getConnection();
    ods.close();
    db = con.createStatement();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.