1 22 package org.jboss.test.jca.jdbc; 23 24 import java.sql.Driver ; 25 import java.sql.SQLException ; 26 import java.util.Properties ; 27 import java.sql.Connection ; 28 import java.sql.DriverPropertyInfo ; 29 30 39 40 public class TestDriver implements Driver 41 { 42 43 private boolean fail = false; 44 45 private int closedCount = 0; 46 47 48 public TestDriver() { 49 50 } 51 52 public void setFail(boolean fail) 53 { 54 this.fail = fail; 55 } 56 57 public boolean getFail() 58 { 59 return fail; 60 } 61 62 public int getClosedCount() 63 { 64 return closedCount; 65 } 66 67 public void connectionClosed() 68 { 69 closedCount++; 70 } 71 72 74 public boolean acceptsURL(String string) throws SQLException { 75 return string != null && string.startsWith("jdbc:jboss-test-adapter"); 76 } 77 78 public Connection connect(String url, Properties info) throws SQLException 79 { 80 return new TestConnection(this); 81 } 82 83 public int getMajorVersion() 84 { 85 return 1; 86 } 87 88 public int getMinorVersion() 89 { 90 return 0; 91 } 92 93 public DriverPropertyInfo [] getPropertyInfo(String url, Properties info) 94 { 95 return null; 96 } 97 98 public boolean jdbcCompliant() 99 { 100 return false; 101 } 102 103 } | Popular Tags |