1 package in.co.daffodil.db.jdbc; 2 3 import java.io.*; 4 import java.sql.*; 5 import java.util.*; 6 import com.daffodilwoods.daffodildb.server.serversystem._Server; 7 8 public abstract class AbstractDaffodilDBDriver implements Driver{ 9 10 public static final String DATABASE_NAME_PROPERTY = "databaseName"; 11 public static final String DATABASE_HOME_PROPERTY = "path"; 12 public static final String DATABASE_CREATE_PROPERTY = "create"; 13 public static final int COLUMN_OFFSET = 0; 14 public static final String STATEMENT_CACHE = "cachestatement"; 15 16 protected static _Server server; 17 protected static Driver driver; 18 19 public AbstractDaffodilDBDriver() { 20 } 21 22 public java.sql.Connection connect(String url,Properties info) throws SQLException { 23 if (!acceptsURL(url)) 24 return null; info = breakURL(url, info); 26 try { 27 }catch (Exception e) { 28 } 29 return getConnection(url, info); 30 } 31 32 protected abstract java.util.Properties breakURL(String url,java.util.Properties info) throws SQLException; 33 34 protected abstract Connection getConnection(String url, Properties info) throws SQLException; 35 36 public abstract boolean acceptsURL(String url) throws SQLException ; 37 38 public abstract DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException ; 39 40 public void setServer(_Server server){ 41 42 } 43 44 protected abstract _Server getServer(String url) throws SQLException ; 45 public int getMajorVersion() { 46 return DatabaseProperties.driverMajorVersion; 47 } 48 49 public int getMinorVersion() { 50 return DatabaseProperties.driverMinorVersion; 51 } 52 53 public boolean jdbcCompliant() { 54 return DatabaseProperties.jdbcCompliant; 55 } 56 protected boolean isStatementCached(Object obj){ 57 return obj != null && obj.toString().trim().equalsIgnoreCase("true") ? true : false; 58 } 59 } 60 | Popular Tags |