Package com.winvector.db.DBUtil

Examples of com.winvector.db.DBUtil.DBHandle


    final String dbUserName = "JunitTestDB";
    final String dbPassword = "JunitTestDB";
    final String dbURL = "jdbc:h2:" + dbName;
    final String driver = "org.h2.Driver";
    final boolean readOnly = false;
    final DBHandle dbhandle = DBUtil.buildConnection(comment, dbUserName, dbPassword, dbURL, driver, readOnly);
    Exception ex = null;
    try {
      final Statement stmt = dbhandle.conn.createStatement();
      stmt.executeUpdate("CREATE TABLE TESTTAB (IARG INT, SARG VARCHAR(128), BIARG NUMERIC(30), BNARG NUMERIC(30,20), DARG DOUBLE PRECISION)");
      final PreparedStatement pstmt = dbhandle.conn.prepareStatement("INSERT INTO TESTTAB (IARG, SARG, BIARG, BNARG, DARG) VALUES (?, ?, ?, ?, ?)");
View Full Code Here


    final Properties p = new Properties();
    p.setProperty(DBUtil.USERKEY,"JunitTestDB");
    p.setProperty(DBUtil.PASSWORDKEY,"JunitTestDB");
    p.setProperty(DBUtil.URLKEY,"jdbc:h2:" + dbName);
    p.setProperty(DBUtil.DRIVERKEY,"org.h2.Driver");
    final DBHandle dbhandle = DBUtil.buildConnection("JunitTestDB", p, readOnly);
    Exception ex = null;
    try {
      final String sourceName = "test";
      final ArrayList<BurstMap> source = new ArrayList<BurstMap>();
      final TreeMap<String, Object> mp = new TreeMap<String,Object>();
View Full Code Here

   
    System.out.println("\tDBProperties XML:\t" + propsURI.toString());
    System.out.println("\tquery:\t" + query);
    System.out.println("\tresultFile:\t" + resFile.getAbsolutePath());
    final Properties props = DBUtil.loadProps(propsURI);
    final DBHandle handle = DBUtil.buildConnection(propsURI.toString(),props,true);
    System.out.println("\tdb:\t" + handle);
    final PrintStream p = TrivialReader.openPrintStream(resFile);
   
    final long nRows = runQuery(query,p,handle);
   
View Full Code Here

    System.out.println("\tcwd: " + (new File(".")).getAbsolutePath());
    System.out.println("\tDBProperties XML:\t" + propsURI.toString());
    System.out.println("\tsep: " + sep);
    System.out.println("\ttableName:\t" + tableName);
    final Properties props = DBUtil.loadProps(propsURI);
    final DBHandle handle = DBUtil.buildConnection(propsURI.toString(),props,false);
    System.out.println("\tdb:\t" + handle);
    try {
      handle.conn.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
    } catch (Exception ex) {
    }
View Full Code Here

    System.out.println("\tDBProperties XML:\t" + propsURI.toString());
    System.out.println("\tsep: " + sep);
    System.out.println("\tSource URI:\t" + inURI);
    System.out.println("\ttableName:\t" + tableName);
    final Properties props = DBUtil.loadProps(propsURI);
    final DBHandle handle = DBUtil.buildConnection(propsURI.toString(),props,false);
    System.out.println("\tdb:\t" + handle);
    try {
      handle.conn.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
    } catch (Exception ex) {
    }
View Full Code Here

    final String tableName = args[2];
    System.out.println("\tcwd: " + (new File(".")).getAbsolutePath());
    System.out.println("\tDBProperties XML:\t" + propsURI.toString());
    System.out.println("\ttableName:\t" + tableName);
    final Properties props = DBUtil.loadProps(propsURI);
    final DBHandle handle = DBUtil.buildConnection(propsURI.toString(),props,false);
    System.out.println("\tdb:\t" + handle);
    final ArrayList<FixedFieldDef> origFieldDefs = readFieldDefs(new TrivialReader(fieldSpecURI,'\t',null,true,null, false));
    final ArrayList<FixedFieldDef> fieldDefs = notCoveredBySingles(origFieldDefs);
    try {
      handle.conn.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
View Full Code Here

    }
   
    System.out.println("\tDBProperties XML:\t" + propsURI.toString());
    System.out.println("\tquery:\t" + query);
    System.out.println("\tresultFile:\t" + resFile.getAbsolutePath());
    final DBHandle handle = DBUtil.buildConnection(propsURI,true);
    System.out.println("\tdb:\t" + handle);
    final PrintStream p = TrivialReader.openPrintStream(resFile);
   
    final long nRows = runQuery(query,p,handle);
   
View Full Code Here

    final String tableName = args[2];
    System.out.println("\tcwd: " + (new File(".")).getAbsolutePath());
    System.out.println("\tDBProperties XML:\t" + propsURI.toString());
    System.out.println("\tsep: " + sep);
    System.out.println("\ttableName:\t" + tableName);
    final DBHandle handle = DBUtil.buildConnection(propsURI,false);
    System.out.println("\tdb:\t" + handle);
    try {
      handle.conn.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
    } catch (Exception ex) {
    }
View Full Code Here

    System.out.println("\tcwd: " + (new File(".")).getAbsolutePath());
    System.out.println("\tDBProperties XML:\t" + propsURI.toString());
    System.out.println("\tsep: " + sep);
    System.out.println("\tSource URI:\t" + inURI);
    System.out.println("\ttableName:\t" + tableName);
    final DBHandle handle = DBUtil.buildConnection(propsURI,false);
    System.out.println("\tdb:\t" + handle);
    try {
      handle.conn.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
    } catch (Exception ex) {
    }
View Full Code Here

TOP

Related Classes of com.winvector.db.DBUtil.DBHandle

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.