1 28 29 30 package com.caucho.tools.profiler; 31 32 import java.sql.Connection ; 33 import java.sql.Driver ; 34 import java.sql.DriverPropertyInfo ; 35 import java.sql.SQLException ; 36 import java.util.Properties ; 37 38 public class DriverWrapper 39 implements Driver 40 { 41 private final ProfilerPoint _profilerPoint; 42 private final Driver _driver; 43 44 public DriverWrapper(ProfilerPoint profilerPoint, Driver driver) 45 { 46 _profilerPoint = profilerPoint; 47 _driver = driver; 48 } 49 50 private Connection wrap(Connection connection) 51 { 52 return new ConnectionWrapper(_profilerPoint, connection); 53 } 54 55 public Connection connect(String url, Properties info) 56 throws SQLException 57 { 58 return wrap(_driver.connect(url, info)); 59 } 60 61 public boolean acceptsURL(String url) 62 throws SQLException 63 { 64 return _driver.acceptsURL(url); 65 } 66 67 public DriverPropertyInfo [] getPropertyInfo(String url, Properties info) 68 throws SQLException 69 { 70 return _driver.getPropertyInfo(url, info); 71 } 72 73 public int getMajorVersion() 74 { 75 return _driver.getMajorVersion(); 76 } 77 78 public int getMinorVersion() 79 { 80 return _driver.getMinorVersion(); 81 } 82 83 public boolean jdbcCompliant() 84 { 85 return _driver.jdbcCompliant(); 86 } 87 88 public String toString() 89 { 90 return "DriverWrapper[" + _profilerPoint.getName() + "]"; 91 } 92 } 93 | Popular Tags |