Ejemplo n.º 1
0
 ConnectionWrapper(Connection con) {
   this.connection =
       (Connection)
           Proxy.newProxyInstance(
               con.getClass().getClassLoader(), con.getClass().getInterfaces(), this);
   m_originConnection = con;
 }
Ejemplo n.º 2
0
 public static final Connection getConnection() throws SQLException {
   Connection conn = conns.get();
   if (conn == null || conn.isClosed()) {
     conn = _getConnection();
     if (conn == null) throw new SQLException("Unabled to get connection.");
     conns.set(conn);
     // RequestContext ctx = RequestContext.get();
     // connectionContext.put(
     // Thread.currentThread().getId(),
     // new ConnectionContext(new Exception(), (ctx != null) ? ctx
     // .ip() : null, (ctx != null) ? ctx.uri() : null,
     // (ctx != null) ? ctx.request().getParameterMap()
     // : null));
   }
   return (show_sql && !Proxy.isProxyClass(conn.getClass()))
       ? new _DebugConnection(conn).getConnection()
       : conn;
 }
Ejemplo n.º 3
0
 /**
  * Returns the conn.
  *
  * @return Connection
  */
 public Connection getConnection() {
   return (Connection)
       Proxy.newProxyInstance(
           conn.getClass().getClassLoader(), conn.getClass().getInterfaces(), this);
 }