Example #1
0
 public Connection connect(java.lang.String dburl, java.util.Properties info) throws SQLException {
   if (acceptsURL(dburl)) {
     String dbname = dburl.substring(URL_PREFIX_LEN);
     try {
       java.util.Vector param = TextUtils.getWords(dbname, "/");
       if (param.size() > 1)
         return DBLogicalManager.getPoolConnection(
             param.elementAt(0).toString(), getIntValue(param.elementAt(1).toString(), 0));
       else return DBLogicalManager.getPoolConnection(dbname);
     } catch (ConnectTimeoutException cte) {
       throw new SQLException(cte.getMessage(), "TIMEOUT");
     } catch (DatabaseMarkdownException dme) {
       throw new SQLException(dme.getMessage(), "MARKDOWN");
     }
   }
   throw new SQLException("invalid url string error.");
 }
Example #2
0
  public AnySQLDriver(String cfgfile) {
    try {
      DriverManager.registerDriver(this);
    } catch (SQLException sqle) {
    }

    VariableTable vt = new VariableTable();
    vt.loadFile(cfgfile);
    DBPhysicalManager.loadDBConfig(vt);
    DBLogicalManager.loadDBConfig(vt);
    DBPhysicalManager.markupAll();
  }
Example #3
0
 public AnySQLDriver() {
   try {
     DriverManager.registerDriver(this);
   } catch (SQLException sqle) {
   }
   String cfgfile = System.getProperty("db.config");
   VariableTable vt = new VariableTable();
   if (cfgfile != null) {
     vt.loadFile(cfgfile);
     DBPhysicalManager.loadDBConfig(vt);
     DBLogicalManager.loadDBConfig(vt);
     DBPhysicalManager.markupAll();
   }
 }