Exemple #1
0
 public boolean acceptsURL(java.lang.String dburl) throws SQLException {
   try {
     return dburl.startsWith(URL_PREFIX);
   } catch (NullPointerException e) {
     return false;
   }
 }
Exemple #2
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.");
 }