1 6 package org.logicalcobwebs.proxool; 7 8 import java.sql.Connection ; 9 import java.sql.Driver ; 10 import java.sql.DriverManager ; 11 import java.sql.DriverPropertyInfo ; 12 import java.sql.SQLException ; 13 import java.util.Properties ; 14 15 35 public class VirtoolDriver implements Driver { 36 37 private static final String VIRTOOL = "virtool"; 38 39 private String [] activePools; 40 41 private int nextPool; 42 43 public Connection connect(String url, Properties info) 44 throws SQLException { 45 String alias = activePools[nextPool]; 46 47 51 return null; 52 } 53 54 public boolean acceptsURL(String url) throws SQLException { 55 return (url.startsWith(VIRTOOL)); 56 } 57 58 public DriverPropertyInfo [] getPropertyInfo(String url, Properties info) 59 throws SQLException { 60 return new DriverPropertyInfo [0]; 61 } 62 63 public int getMajorVersion() { 64 throw new UnsupportedOperationException ("This virtual driver doesn't support this operation."); 65 } 66 67 public int getMinorVersion() { 68 throw new UnsupportedOperationException ("This virtual driver doesn't support this operation."); 69 } 70 71 public boolean jdbcCompliant() { 72 throw new UnsupportedOperationException ("This virtual driver doesn't support this operation."); 73 } 74 75 static { 76 try { 77 DriverManager.registerDriver(new VirtoolDriver()); 78 } catch (SQLException e) { 79 System.out.println(e.toString()); 80 } 81 } 82 83 } 84 85 104 | Popular Tags |