1 22 package com.sqlmagic.tinysql; 23 24 import java.sql.Connection ; 25 import java.sql.DriverPropertyInfo ; 26 import java.sql.SQLException ; 27 import java.sql.Driver ; 28 import java.util.Properties ; 29 30 31 36 public class dbfFileDriver extends tinySQLDriver { 37 38 44 static { 45 try { 46 java.sql.DriverManager.registerDriver(new dbfFileDriver()); 47 } catch (Exception e) { 48 e.printStackTrace(); 49 } 50 } 51 52 57 public dbfFileDriver() { 58 super(); 59 } 60 61 72 public tinySQLConnection getConnection 73 (String user, String url, Driver d) 74 throws SQLException { 75 76 return (tinySQLConnection) new dbfFileConnection(user, url, d); 77 } 78 79 88 public boolean acceptsURL(String url) throws SQLException { 89 90 if( url.length() < 12 ) { 95 return false; 96 } 97 98 return url.substring(5,12).equals("dbfFile"); 102 103 } 104 105 } 106 | Popular Tags |