Package nz.co.transparent.client.db

Examples of nz.co.transparent.client.db.PoolingDriverHandler


    }
     
  }

  public static void main(String args[]) {
    nz.co.transparent.client.db.PoolingDriverHandler dbcPool  =  new PoolingDriverHandler("client");
    new TestMetaData1().go();
    dbcPool.closeConnectionPool();
  }
View Full Code Here


    super();
  }

  private void go() {
   
    PoolingDriverHandler databaseConnectionPool = new PoolingDriverHandler();
    Connection conn;
   
    try {
      conn = DriverManager.getConnection(Constants.JDBC_URL);
      // If AutoCommit is true then we are not using a transaction
View Full Code Here

  }

 
  public static void main (String[] args) {

    PoolingDriverHandler databaseConnectionPool = new PoolingDriverHandler();
    java.util.List list = null;

//    try {
//      List columnPropertyList = TableMetaData.getTableColumnProperties("client", "COLUMN_NAME");
//      Iterator iterator = columnPropertyList.iterator();
View Full Code Here

    super();
  }

  private void go() {
   
    PoolingDriverHandler databaseConnectionPool = new PoolingDriverHandler("client");
    Connection conn;
   
    try {
      conn = DriverManager.getConnection(Constants.JDBC_URL);
      conn.setAutoCommit(false);
View Full Code Here

    super();
  }

  private void go() {
   
    PoolingDriverHandler databaseConnectionPool = new PoolingDriverHandler("client");
    Connection conn;
   
    try {
      conn = DriverManager.getConnection(Constants.JDBC_URL);
      conn.setAutoCommit(false);
View Full Code Here

    super();
  }

  private void go() {

    PoolingDriverHandler databaseConnectionPool =
      new PoolingDriverHandler("client");
    Connection connection1;
    Connection connection2;

    try {
      // Create two JDBC connections to the database.
View Full Code Here

      log.warning(message);
    }
  }

  public static void main(String args[]) {
    nz.co.transparent.client.db.PoolingDriverHandler dbcPool  =  new PoolingDriverHandler("client");
    new TestClientMetaData().go();
    dbcPool.closeConnectionPool();
  }
View Full Code Here

    super();
  }

  private void go() {
   
    PoolingDriverHandler databaseConnectionPool = new PoolingDriverHandler("client");
    Connection connRead;
    Connection connUpdate;
   
    try {
      // If AutoCommit is true then we are not using a transaction
View Full Code Here

public class TestSpecialChars {

  // This test uses ConnectionPool.close() to check database corruption
  public static void main(String[] args) {
   
    nz.co.transparent.client.db.PoolingDriverHandler dbConnectionPool  =  new PoolingDriverHandler("client");
   
    // Now, we can use JDBC as we normally would.
    // Using the connect string
    //  jdbc:apache:commons:dbcp:example
    // The general form being:
    //  jdbc:apache:commons:dbcp:<name-of-pool>
    //

    Connection conn = null;
    PreparedStatement pstmt = null;
    Statement stmt = null;
    ResultSet rset = null;
    String sql;

    long startTime = new Date().getTime();
    long currentTime;
    System.out.println("Creating connection.");
   
    try {
      conn = DriverManager.getConnection("jdbc:apache:commons:dbcp:testPool");
      System.out.println("Connection time=" + (new Date().getTime() - startTime));
      System.out.println("Creating statement.");

      // Clean table
      stmt = conn.createStatement();
      rset = stmt.executeQuery("delete from Test;");

      sql = "insert into APP.Test " +
        "set TestID=? " +
        ", TextField=?";
      pstmt = conn.prepareStatement(sql);
      pstmt.setInt(1, 1);
      pstmt.setString(2, "Test single quote O'reilly");
      rset = pstmt.executeQuery();
      System.out.println("Executing statement.");
    } catch(SQLException e) {
      e.printStackTrace();
      try { pstmt.close(); } catch(Exception e1) { }
      try { conn.close(); } catch(Exception e2) { }
      return;
    }
   
    try { pstmt.close(); } catch(Exception e2) { }
    try { conn.close(); } catch(Exception e2) { }

    // Close connection pool
    try {
      dbConnectionPool.closeConnectionPool();
    } catch (Exception e) {
      System.out.println("Exception thrown closing connection pool:");
      System.out.println(e.getMessage());
    }
   
View Full Code Here

    super();
  }

  private void go() {
   
    PoolingDriverHandler databaseConnectionPool = new PoolingDriverHandler("client");
    Connection conn;
   
    try {
      conn = DriverManager.getConnection(Constants.JDBC_URL);
      // If AutoCommit is true then we are not using a transaction
View Full Code Here

TOP

Related Classes of nz.co.transparent.client.db.PoolingDriverHandler

Copyright © 2018 www.massapicom. 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.