1 33 34 package com.sqlmagic.tinysql; 35 36 import java.sql.Connection ; 37 import java.sql.DriverPropertyInfo ; 38 import java.sql.SQLException ; 39 import java.sql.Driver ; 40 import java.util.Properties ; 41 42 public abstract class tinySQLDriver implements java.sql.Driver { 43 44 49 public tinySQLDriver() { 50 } 51 52 62 public Connection connect(String url, Properties info) 63 throws SQLException { 64 65 if( !acceptsURL(url) ) { 66 return null; 67 } 68 69 return getConnection(info.getProperty("user"), url, this); 72 } 73 74 83 public boolean acceptsURL(String url) throws SQLException { 84 85 if( url.length() < 12 ) { 90 return false; 91 } 92 93 return url.substring(5,12).equals("tinySQL"); 97 98 } 99 100 117 public DriverPropertyInfo [] getPropertyInfo(String url, 118 java.util.Properties info) 119 throws SQLException { 120 return new DriverPropertyInfo [0]; 121 } 122 123 130 public int getMajorVersion() { 131 return 0; 132 } 133 134 141 public int getMinorVersion() { 142 return 9; 143 } 144 145 151 public boolean jdbcCompliant() { 152 return false; 153 } 154 155 161 public abstract tinySQLConnection getConnection 162 (String user, String url, Driver d) 163 throws SQLException ; 164 165 } 166 | Popular Tags |