You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by ms...@apache.org on 2007/02/20 20:14:12 UTC

svn commit: r509713 [1/2] - in /incubator/ode/trunk/minerva: bin/ bin/src/ bin/src/main/ bin/src/main/java/ bin/src/main/java/org/ bin/src/main/java/org/opentools/ bin/src/main/java/org/opentools/minerva/ bin/src/main/java/org/opentools/minerva/cache/ ...

Author: mszefler
Date: Tue Feb 20 11:14:10 2007
New Revision: 509713

URL: http://svn.apache.org/viewvc?view=rev&rev=509713
Log:
Implement JDBC3.0 methods

Added:
    incubator/ode/trunk/minerva/bin/
    incubator/ode/trunk/minerva/bin/.project
    incubator/ode/trunk/minerva/bin/pom.xml
    incubator/ode/trunk/minerva/bin/src/
    incubator/ode/trunk/minerva/bin/src/main/
    incubator/ode/trunk/minerva/bin/src/main/java/
    incubator/ode/trunk/minerva/bin/src/main/java/org/
    incubator/ode/trunk/minerva/bin/src/main/java/org/opentools/
    incubator/ode/trunk/minerva/bin/src/main/java/org/opentools/minerva/
    incubator/ode/trunk/minerva/bin/src/main/java/org/opentools/minerva/cache/
    incubator/ode/trunk/minerva/bin/src/main/java/org/opentools/minerva/connector/
    incubator/ode/trunk/minerva/bin/src/main/java/org/opentools/minerva/connector/jdbc/
    incubator/ode/trunk/minerva/bin/src/main/java/org/opentools/minerva/jdbc/
    incubator/ode/trunk/minerva/bin/src/main/java/org/opentools/minerva/jdbc/xa/
    incubator/ode/trunk/minerva/bin/src/main/java/org/opentools/minerva/jdbc/xa/wrapper/
    incubator/ode/trunk/minerva/bin/src/main/java/org/opentools/minerva/pool/
    incubator/ode/trunk/minerva/bin/src/main/java/org/opentools/minerva/xml/
    incubator/ode/trunk/minerva/bin/target/
    incubator/ode/trunk/minerva/bin/target/classes/
    incubator/ode/trunk/minerva/bin/target/classes/org/
    incubator/ode/trunk/minerva/bin/target/classes/org/opentools/
    incubator/ode/trunk/minerva/bin/target/classes/org/opentools/minerva/
    incubator/ode/trunk/minerva/bin/target/classes/org/opentools/minerva/cache/
    incubator/ode/trunk/minerva/bin/target/classes/org/opentools/minerva/connector/
    incubator/ode/trunk/minerva/bin/target/classes/org/opentools/minerva/connector/jdbc/
    incubator/ode/trunk/minerva/bin/target/classes/org/opentools/minerva/jdbc/
    incubator/ode/trunk/minerva/bin/target/classes/org/opentools/minerva/jdbc/xa/
    incubator/ode/trunk/minerva/bin/target/classes/org/opentools/minerva/jdbc/xa/wrapper/
    incubator/ode/trunk/minerva/bin/target/classes/org/opentools/minerva/pool/
    incubator/ode/trunk/minerva/bin/target/classes/org/opentools/minerva/xml/
    incubator/ode/trunk/minerva/bin/target/ode-minerva-2.0-SNAPSHOT.jar   (with props)
    incubator/ode/trunk/minerva/bin/test/
    incubator/ode/trunk/minerva/bin/test/java/
    incubator/ode/trunk/minerva/src/main/java/org/apache/
    incubator/ode/trunk/minerva/src/main/java/org/apache/ode/
    incubator/ode/trunk/minerva/src/main/java/org/apache/ode/minerva/
    incubator/ode/trunk/minerva/src/main/java/org/apache/ode/minerva/dsutil/
Modified:
    incubator/ode/trunk/minerva/src/main/java/org/opentools/minerva/jdbc/ConnectionInPool.java
    incubator/ode/trunk/minerva/src/main/java/org/opentools/minerva/jdbc/ResultSetInPool.java
    incubator/ode/trunk/minerva/src/main/java/org/opentools/minerva/jdbc/StatementInPool.java

Added: incubator/ode/trunk/minerva/bin/.project
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/minerva/bin/.project?view=auto&rev=509713
==============================================================================
--- incubator/ode/trunk/minerva/bin/.project (added)
+++ incubator/ode/trunk/minerva/bin/.project Tue Feb 20 11:14:10 2007
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>ode-minerva</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: incubator/ode/trunk/minerva/bin/pom.xml
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/minerva/bin/pom.xml?view=auto&rev=509713
==============================================================================
--- incubator/ode/trunk/minerva/bin/pom.xml (added)
+++ incubator/ode/trunk/minerva/bin/pom.xml Tue Feb 20 11:14:10 2007
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~    http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<project>
+  <groupId>org.apache.ode</groupId>
+  <artifactId>ode-minerva</artifactId>
+  <name>ODE :: Minerva JDBC Pool</name>
+
+  <version>2.0-SNAPSHOT</version>
+  <packaging>jar</packaging>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.ode</groupId>
+    <artifactId>ode</artifactId>
+    <version>2.0-SNAPSHOT</version>
+  </parent>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-j2ee-connector_1.5_spec</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-jta_1.0.1B_spec</artifactId>
+    </dependency>
+    <dependency>
+       <groupId>commons-logging</groupId>
+       <artifactId>commons-logging</artifactId>
+    </dependency>
+  </dependencies>
+</project>

Added: incubator/ode/trunk/minerva/bin/target/ode-minerva-2.0-SNAPSHOT.jar
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/minerva/bin/target/ode-minerva-2.0-SNAPSHOT.jar?view=auto&rev=509713
==============================================================================
Binary file - no diff available.

Propchange: incubator/ode/trunk/minerva/bin/target/ode-minerva-2.0-SNAPSHOT.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: incubator/ode/trunk/minerva/src/main/java/org/opentools/minerva/jdbc/ConnectionInPool.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/minerva/src/main/java/org/opentools/minerva/jdbc/ConnectionInPool.java?view=diff&rev=509713&r1=509712&r2=509713
==============================================================================
--- incubator/ode/trunk/minerva/src/main/java/org/opentools/minerva/jdbc/ConnectionInPool.java (original)
+++ incubator/ode/trunk/minerva/src/main/java/org/opentools/minerva/jdbc/ConnectionInPool.java Tue Feb 20 11:14:10 2007
@@ -22,8 +22,22 @@
  */
 package org.opentools.minerva.jdbc;
 
-import java.sql.*;
-import java.util.*;
+import java.sql.CallableStatement;
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+import java.sql.SQLWarning;
+import java.sql.Savepoint;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Vector;
 
 import org.opentools.minerva.cache.LeastRecentlyUsedCache;
 import org.opentools.minerva.cache.ObjectCache;
@@ -32,35 +46,41 @@
 import org.opentools.minerva.pool.PooledObject;
 
 /**
- * Wrapper for database connections in a pool.  Handles closing appropriately.
- * The connection is returned to the pool rather than truly closing, any
- * outstanding statements are closed, and the connection is rolled back.  This
- * class is also used by statements, etc. to update the last used time for the
- * connection.
- *
+ * Wrapper for database connections in a pool. Handles closing appropriately. The connection is returned to the pool rather than
+ * truly closing, any outstanding statements are closed, and the connection is rolled back. This class is also used by statements,
+ * etc. to update the last used time for the connection.
+ * 
  * @author Aaron Mulder (ammulder@alumni.princeton.edu)
  */
 public class ConnectionInPool implements PooledObject, ConnectionWrapper {
     private final static String CLOSED = "Connection has been closed!";
+
     public final static int PS_CACHE_UNLIMITED = 0;
+
     public final static int PS_CACHE_DISABLED = -1;
-    public final static Map<Connection, ObjectCache> psCaches =
-      new HashMap<Connection, ObjectCache>();
+
+    public final static Map<Connection, ObjectCache> psCaches = new HashMap<Connection, ObjectCache>();
 
     private Connection con;
+
     private Set<Statement> statements;
+
     private Vector<PoolEventListener> listeners;
+
     private int preparedStatementCacheSize = 0;
+
     private ObjectCache preparedStatementCache;
 
     /**
      * Creates a new connection wrapper.
-     * @param con The "real" database connection to wrap.
+     * 
+     * @param con
+     *            The "real" database connection to wrap.
      */
     public ConnectionInPool(Connection con) {
         this.con = con;
         preparedStatementCache = psCaches.get(con);
-        if(preparedStatementCache == null) {
+        if (preparedStatementCache == null) {
             PreparedStatementFactory factory = new PreparedStatementFactory(con);
             preparedStatementCache = new LeastRecentlyUsedCache(factory, preparedStatementCacheSize);
             psCaches.put(con, preparedStatementCache);
@@ -69,74 +89,21 @@
         listeners = new Vector<PoolEventListener>();
     }
 
-  public int getHoldability() throws SQLException {
-    throw new UnsupportedOperationException("New JDBC features not supported!");
-  }
-
-  public void setHoldability(int holdability) throws SQLException {
-    throw new UnsupportedOperationException("New JDBC features not supported!");
-  }
-
-  public Savepoint setSavepoint() throws SQLException {
-    throw new UnsupportedOperationException("New JDBC features not supported!");
-  }
-
-  public void releaseSavepoint(Savepoint savepoint) throws SQLException {
-    throw new UnsupportedOperationException("New JDBC features not supported!");
-  }
-
-  public void rollback(Savepoint savepoint) throws SQLException {
-    throw new UnsupportedOperationException("New JDBC features not supported!");
-  }
-
-  public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {
-    throw new UnsupportedOperationException("New JDBC features not supported!");
-  }
-
-  public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {
-    throw new UnsupportedOperationException("New JDBC features not supported!");
-  }
-
-  public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
-    return prepareStatement(new PreparedStatementArgs(sql, autoGeneratedKeys));
-  }
-
-  public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {
-    throw new UnsupportedOperationException("New JDBC features not supported!");
-  }
-
-  public PreparedStatement prepareStatement(String sql, int columnIndexes[]) throws SQLException {
-    throw new UnsupportedOperationException("New JDBC features not supported!");
-  }
-
-  public Savepoint setSavepoint(String name) throws SQLException {
-    throw new UnsupportedOperationException("New JDBC features not supported!");
-  }
-
-  public PreparedStatement prepareStatement(String sql, String columnNames[]) throws SQLException {
-    throw new UnsupportedOperationException("New JDBC features not supported!");
-  }
-  
-  /**
-   * @see java.sql.Connection#prepareStatement(java.lang.String)
-   */
-  public PreparedStatement prepareStatement(String sql) throws SQLException {
-  	return prepareStatement(new PreparedStatementArgs(sql));
-  }
-
-    /**
-     * Creates a new connection wrapper, using the specified maximum size for
-     * the prepared statement cache.
-     * @param con The "real" database connection to wrap.
-     * @param psCacheSize The size of the PreparedStatement cache.
+    /**
+     * Creates a new connection wrapper, using the specified maximum size for the prepared statement cache.
+     * 
+     * @param con
+     *            The "real" database connection to wrap.
+     * @param psCacheSize
+     *            The size of the PreparedStatement cache.
      * @see #PS_CACHE_UNLIMITED
      * @see #PS_CACHE_DISABLED
      */
     public ConnectionInPool(Connection con, int psCacheSize) {
         this.con = con;
-        if(psCacheSize >= 0) {
+        if (psCacheSize >= 0) {
             preparedStatementCache = psCaches.get(con);
-            if(preparedStatementCache == null) {
+            if (preparedStatementCache == null) {
                 PreparedStatementFactory factory = new PreparedStatementFactory(con);
                 preparedStatementCache = new LeastRecentlyUsedCache(factory, preparedStatementCacheSize);
                 psCaches.put(con, preparedStatementCache);
@@ -148,21 +115,20 @@
     }
 
     /**
-     * Sets the number of PreparedStatements to be cached for each
-     * Connection.  Your DB product may impose a limit on the number
-     * of open PreparedStatements.
+     * Sets the number of PreparedStatements to be cached for each Connection. Your DB product may impose a limit on the number of
+     * open PreparedStatements.
+     * 
      * @see #PS_CACHE_UNLIMITED
      * @see #PS_CACHE_DISABLED
      */
     public void setPSCacheSize(int maxSize) {
         preparedStatementCacheSize = maxSize;
-        if(maxSize >= 0 && preparedStatementCache != null)
+        if (maxSize >= 0 && preparedStatementCache != null)
             preparedStatementCache.setSize(maxSize);
     }
 
     /**
-     * Gets the number of PreparedStatements to be cached for each
-     * Connection.
+     * Gets the number of PreparedStatements to be cached for each Connection.
      */
     public int getPSCacheSize() {
         return preparedStatementCacheSize;
@@ -183,18 +149,15 @@
     }
 
     /**
-     * Gets a reference to the "real" connection.  This should only be used if
-     * you need to cast that to a specific type to call a proprietary method -
-     * you will defeat all the pooling if you use the underlying connection
-     * directly.
+     * Gets a reference to the "real" connection. This should only be used if you need to cast that to a specific type to call a
+     * proprietary method - you will defeat all the pooling if you use the underlying connection directly.
      */
     public Connection getUnderlyingConnection() {
         return con;
     }
 
     /**
-     * Closes this connection wrapper permanently.  All further calls with throw
-     * a SQLException.
+     * Closes this connection wrapper permanently. All further calls with throw a SQLException.
      */
     public void shutdown() {
         con = null;
@@ -226,9 +189,8 @@
     }
 
     /**
-     * Indicates that a statement has been closed and no longer needs to be
-     * tracked.  Outstanding statements are closed when the connection is
-     * returned to the pool.
+     * Indicates that a statement has been closed and no longer needs to be tracked. Outstanding statements are closed when the
+     * connection is returned to the pool.
      */
     public void statementClosed(Statement st) {
         statements.remove(st);
@@ -236,42 +198,35 @@
             // Now return the "real" statement to the pool
             PreparedStatementInPool ps = (PreparedStatementInPool) st;
             PreparedStatement ups = ps.getUnderlyingPreparedStatement();
-            if(preparedStatementCacheSize >= 0) {
+            if (preparedStatementCacheSize >= 0) {
                 preparedStatementCache.returnObject(ps.getArgs(), ups);
             } else {
                 try {
                     ups.close();
-                } catch(SQLException e) {}
-            }
-/*
-            int rsType = ResultSet.TYPE_FORWARD_ONLY;
-            int rsConcur = ResultSet.CONCUR_READ_ONLY;
-
-            // We may have JDBC 1.0 driver
-            try {
-                rsType = ups.getResultSetType();
-                rsConcur = ups.getResultSetConcurrency();
-            } catch (Throwable th) {
+                } catch (SQLException e) {
+                }
             }
-            PreparedStatementInPool.preparedStatementCache.put(
-                    new PSCacheKey(con, ps.getSql(), rsType, rsConcur), ups);
-*/
+            /*
+             * int rsType = ResultSet.TYPE_FORWARD_ONLY; int rsConcur = ResultSet.CONCUR_READ_ONLY; // We may have JDBC 1.0 driver
+             * try { rsType = ups.getResultSetType(); rsConcur = ups.getResultSetConcurrency(); } catch (Throwable th) { }
+             * PreparedStatementInPool.preparedStatementCache.put( new PSCacheKey(con, ps.getSql(), rsType, rsConcur), ups);
+             */
         }
     }
 
     /**
-     * Prepares a connection to be returned to the pool.  All outstanding
-     * statements are closed, and if AutoCommit is off, the connection is
-     * rolled back.  No further SQL calls are possible once this is called.
+     * Prepares a connection to be returned to the pool. All outstanding statements are closed, and if AutoCommit is off, the
+     * connection is rolled back. No further SQL calls are possible once this is called.
      */
     public void reset() throws SQLException {
         List<Statement> copy = new ArrayList<Statement>(statements);
         Iterator<Statement> it = copy.iterator();
-        while(it.hasNext())
+        while (it.hasNext())
             try {
                 it.next().close();
-            } catch(SQLException e) {}
-        if(!con.getAutoCommit()) {
+            } catch (SQLException e) {
+            }
+        if (!con.getAutoCommit()) {
             con.rollback();
         }
         con = null;
@@ -281,36 +236,38 @@
      * Dispatches an event to the listeners.
      */
     protected void firePoolEvent(PoolEvent evt) {
-        Vector local = (Vector)listeners.clone();
-        for(int i=local.size()-1; i >= 0; i--)
-            if(evt.getType() == PoolEvent.OBJECT_CLOSED)
-                ((PoolEventListener)local.elementAt(i)).objectClosed(evt);
-            else if(evt.getType() == PoolEvent.OBJECT_ERROR)
-                ((PoolEventListener)local.elementAt(i)).objectError(evt);
+        Vector local = (Vector) listeners.clone();
+        for (int i = local.size() - 1; i >= 0; i--)
+            if (evt.getType() == PoolEvent.OBJECT_CLOSED)
+                ((PoolEventListener) local.elementAt(i)).objectClosed(evt);
+            else if (evt.getType() == PoolEvent.OBJECT_ERROR)
+                ((PoolEventListener) local.elementAt(i)).objectError(evt);
             else
-                ((PoolEventListener)local.elementAt(i)).objectUsed(evt);
+                ((PoolEventListener) local.elementAt(i)).objectUsed(evt);
     }
 
     // ---- Implementation of java.sql.Connection ----
     public Statement createStatement() throws SQLException {
-        if(con == null) throw new SQLException(CLOSED);
+        if (con == null)
+            throw new SQLException(CLOSED);
         try {
             StatementInPool st = new StatementInPool(con.createStatement(), this);
             statements.add(st);
             return st;
-        } catch(SQLException e) {
+        } catch (SQLException e) {
             setError(e);
             throw e;
         }
     }
 
     public PreparedStatement prepareStatement(PreparedStatementArgs args) throws SQLException {
-        if(con == null) throw new SQLException(CLOSED);
+        if (con == null)
+            throw new SQLException(CLOSED);
         try {
             PreparedStatementInPool wrapper = null;
-            if(preparedStatementCacheSize >= 0) {
-                PreparedStatement ps = (PreparedStatement)preparedStatementCache.useObject(args);
-                if(ps == null)
+            if (preparedStatementCacheSize >= 0) {
+                PreparedStatement ps = (PreparedStatement) preparedStatementCache.useObject(args);
+                if (ps == null)
                     throw new SQLException("Unable to create PreparedStatement!");
                 wrapper = new PreparedStatementInPool(ps, this, args);
             } else {
@@ -318,185 +275,203 @@
             }
             statements.add(wrapper);
             return wrapper;
-        } catch(SQLException e) {
+        } catch (SQLException e) {
             setError(e);
             throw e;
         }
     }
 
     public CallableStatement prepareCall(String sql) throws SQLException {
-        if(con == null) throw new SQLException(CLOSED);
+        if (con == null)
+            throw new SQLException(CLOSED);
         try {
             return con.prepareCall(sql);
-        } catch(SQLException e) {
+        } catch (SQLException e) {
             setError(e);
             throw e;
         }
     }
 
     public String nativeSQL(String sql) throws SQLException {
-        if(con == null) throw new SQLException(CLOSED);
+        if (con == null)
+            throw new SQLException(CLOSED);
         try {
             return con.nativeSQL(sql);
-        } catch(SQLException e) {
+        } catch (SQLException e) {
             setError(e);
             throw e;
         }
     }
 
     public void setAutoCommit(boolean autoCommit) throws SQLException {
-        if(con == null) throw new SQLException(CLOSED);
+        if (con == null)
+            throw new SQLException(CLOSED);
         try {
             con.setAutoCommit(autoCommit);
-        } catch(SQLException e) {
+        } catch (SQLException e) {
             setError(e);
             throw e;
         }
     }
 
     public boolean getAutoCommit() throws SQLException {
-        if(con == null) throw new SQLException(CLOSED);
+        if (con == null)
+            throw new SQLException(CLOSED);
         try {
             return con.getAutoCommit();
-        } catch(SQLException e) {
+        } catch (SQLException e) {
             setError(e);
             throw e;
         }
     }
 
     public void commit() throws SQLException {
-        if(con == null) throw new SQLException(CLOSED);
+        if (con == null)
+            throw new SQLException(CLOSED);
         try {
             con.commit();
-        } catch(SQLException e) {
+        } catch (SQLException e) {
             setCatastrophicError(e);
             throw e;
         }
     }
 
     public void rollback() throws SQLException {
-        if(con == null) throw new SQLException(CLOSED);
+        if (con == null)
+            throw new SQLException(CLOSED);
         try {
             con.rollback();
-        } catch(SQLException e) {
+        } catch (SQLException e) {
             setCatastrophicError(e);
             throw e;
         }
     }
 
     public void close() throws SQLException {
-        if(con == null) throw new SQLException(CLOSED);
+        if (con == null)
+            throw new SQLException(CLOSED);
         firePoolEvent(new PoolEvent(this, PoolEvent.OBJECT_CLOSED));
         shutdown();
     }
 
     public boolean isClosed() throws SQLException {
-        if(con == null) return true;
+        if (con == null)
+            return true;
         try {
             return con.isClosed();
-        } catch(SQLException e) {
+        } catch (SQLException e) {
             setError(e);
             throw e;
         }
     }
 
     public DatabaseMetaData getMetaData() throws SQLException {
-        if(con == null) throw new SQLException(CLOSED);
+        if (con == null)
+            throw new SQLException(CLOSED);
         try {
             return con.getMetaData();
-        } catch(SQLException e) {
+        } catch (SQLException e) {
             setError(e);
             throw e;
         }
     }
 
     public void setReadOnly(boolean readOnly) throws SQLException {
-        if(con == null) throw new SQLException(CLOSED);
+        if (con == null)
+            throw new SQLException(CLOSED);
         try {
             con.setReadOnly(readOnly);
-        } catch(SQLException e) {
+        } catch (SQLException e) {
             setError(e);
             throw e;
         }
     }
 
     public boolean isReadOnly() throws SQLException {
-        if(con == null) throw new SQLException(CLOSED);
+        if (con == null)
+            throw new SQLException(CLOSED);
         try {
             return con.isReadOnly();
-        } catch(SQLException e) {
+        } catch (SQLException e) {
             setError(e);
             throw e;
         }
     }
 
     public void setCatalog(String catalog) throws SQLException {
-        if(con == null) throw new SQLException(CLOSED);
+        if (con == null)
+            throw new SQLException(CLOSED);
         try {
             con.setCatalog(catalog);
-        } catch(SQLException e) {
+        } catch (SQLException e) {
             setError(e);
             throw e;
         }
     }
 
     public String getCatalog() throws SQLException {
-        if(con == null) throw new SQLException(CLOSED);
+        if (con == null)
+            throw new SQLException(CLOSED);
         try {
             return con.getCatalog();
-        } catch(SQLException e) {
+        } catch (SQLException e) {
             setError(e);
             throw e;
         }
     }
 
     public void setTransactionIsolation(int level) throws SQLException {
-        if(con == null) throw new SQLException(CLOSED);
+        if (con == null)
+            throw new SQLException(CLOSED);
         try {
             con.setTransactionIsolation(level);
-        } catch(SQLException e) {
+        } catch (SQLException e) {
             setError(e);
             throw e;
         }
     }
 
     public int getTransactionIsolation() throws SQLException {
-        if(con == null) throw new SQLException(CLOSED);
+        if (con == null)
+            throw new SQLException(CLOSED);
         try {
             return con.getTransactionIsolation();
-        } catch(SQLException e) {
+        } catch (SQLException e) {
             setError(e);
             throw e;
         }
     }
 
     public SQLWarning getWarnings() throws SQLException {
-        if(con == null) throw new SQLException(CLOSED);
+        if (con == null)
+            throw new SQLException(CLOSED);
         try {
             return con.getWarnings();
-        } catch(SQLException e) {
+        } catch (SQLException e) {
             setError(e);
             throw e;
         }
     }
 
     public void clearWarnings() throws SQLException {
-        if(con == null) throw new SQLException(CLOSED);
+        if (con == null)
+            throw new SQLException(CLOSED);
         try {
             con.clearWarnings();
-        } catch(SQLException e) {
+        } catch (SQLException e) {
             setError(e);
             throw e;
         }
     }
 
     public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException {
-        if(con == null) throw new SQLException(CLOSED);
+        if (con == null)
+            throw new SQLException(CLOSED);
         try {
             StatementInPool st = new StatementInPool(con.createStatement(resultSetType, resultSetConcurrency), this);
             statements.add(st);
             return st;
-        } catch(SQLException e) {
+        } catch (SQLException e) {
             setError(e);
             throw e;
         }
@@ -507,36 +482,195 @@
     }
 
     public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException {
-        if(con == null) throw new SQLException(CLOSED);
+        if (con == null)
+            throw new SQLException(CLOSED);
         try {
             return con.prepareCall(sql, resultSetType, resultSetConcurrency);
-        } catch(SQLException e) {
+        } catch (SQLException e) {
             setError(e);
             throw e;
         }
     }
 
-    public Map<String,Class<?>> getTypeMap() throws SQLException {
-        if(con == null) throw new SQLException(CLOSED);
+    public Map<String, Class<?>> getTypeMap() throws SQLException {
+        if (con == null)
+            throw new SQLException(CLOSED);
         try {
             return con.getTypeMap();
-        } catch(SQLException e) {
+        } catch (SQLException e) {
             setError(e);
             throw e;
         }
     }
 
-    public void setTypeMap(Map<String,Class<?>> map) throws SQLException {
-        if(con == null) {
-          throw new SQLException(CLOSED);
+    public void setTypeMap(Map<String, Class<?>> map) throws SQLException {
+        if (con == null) {
+            throw new SQLException(CLOSED);
         }
         try {
             con.setTypeMap(map);
-        } catch(SQLException e) {
+        } catch (SQLException e) {
             setError(e);
             throw e;
         }
     }
 
-	
+    public int getHoldability() throws SQLException {
+        if (con == null)
+            throw new SQLException(CLOSED);
+        try {
+            return con.getHoldability();
+
+        } catch (SQLException e) {
+            setError(e);
+            throw e;
+        }
+    }
+
+    public void setHoldability(int holdability) throws SQLException {
+        if (con == null)
+            throw new SQLException(CLOSED);
+        try {
+            con.setHoldability(holdability);
+        } catch (SQLException e) {
+            setError(e);
+            throw e;
+        }
+    }
+
+    public Savepoint setSavepoint() throws SQLException {
+        if (con == null)
+            throw new SQLException(CLOSED);
+
+        try {
+            return con.setSavepoint();
+        } catch (SQLException e) {
+            setError(e);
+            throw e;
+        }
+    }
+
+    public void releaseSavepoint(Savepoint savepoint) throws SQLException {
+        if (con == null)
+            throw new SQLException(CLOSED);
+        try {
+            con.releaseSavepoint(savepoint);
+        } catch (SQLException e) {
+            setError(e);
+            throw e;
+        }
+    }
+
+    public void rollback(Savepoint savepoint) throws SQLException {
+        if (con == null)
+            throw new SQLException(CLOSED);
+        try {
+            con.rollback(savepoint);
+        } catch (SQLException e) {
+            setError(e);
+            throw e;
+        }
+    }
+
+    public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {
+        if (con == null)
+            throw new SQLException(CLOSED);
+        try {
+            Statement s = con.createStatement(resultSetType, resultSetConcurrency, resultSetHoldability);
+            statements.add(s);
+            return s;
+        } catch (SQLException e) {
+            setError(e);
+            throw e;
+        }
+
+    }
+
+    public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
+            throws SQLException {
+        if (con == null)
+            throw new SQLException(CLOSED);
+        try {
+            CallableStatement cs = con.prepareCall(sql, resultSetType, resultSetConcurrency, resultSetHoldability);
+            statements.add(cs);
+            return cs;
+        } catch (SQLException e) {
+            setError(e);
+            throw e;
+        }
+    }
+
+    public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
+        if (con == null)
+            throw new SQLException(CLOSED);
+        try {
+            return prepareStatement(new PreparedStatementArgs(sql, autoGeneratedKeys));
+        } catch (SQLException e) {
+            setError(e);
+            throw e;
+        }
+
+    }
+
+    public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
+            throws SQLException {
+        if (con == null)
+            throw new SQLException(CLOSED);
+        try {
+            PreparedStatement ps = con.prepareStatement(sql, resultSetType, resultSetConcurrency);
+            statements.add(ps);
+            return ps;
+        } catch (SQLException e) {
+            setError(e);
+            throw e;
+        }
+    }
+
+    public PreparedStatement prepareStatement(String sql, int columnIndexes[]) throws SQLException {
+        if (con == null)
+            throw new SQLException(CLOSED);
+        try {
+            PreparedStatement ps = con.prepareStatement(sql, columnIndexes);
+            statements.add(ps);
+            return ps;
+        } catch (SQLException e) {
+            setError(e);
+            throw e;
+        }
+    }
+
+    public Savepoint setSavepoint(String name) throws SQLException {
+        if (con == null)
+            throw new SQLException(CLOSED);
+
+        try {
+            return con.setSavepoint(name);
+        } catch (SQLException e) {
+            setError(e);
+            throw e;
+        }
+    }
+
+    public PreparedStatement prepareStatement(String sql, String columnNames[]) throws SQLException {
+        if (con == null)
+            throw new SQLException(CLOSED);
+        try {
+            PreparedStatement ps = con.prepareStatement(sql, columnNames);
+            statements.add(ps);
+            return ps;
+        } catch (SQLException e) {
+            setError(e);
+            throw e;
+        }
+    }
+
+    /**
+     * @see java.sql.Connection#prepareStatement(java.lang.String)
+     */
+    public PreparedStatement prepareStatement(String sql) throws SQLException {
+        if (con == null)
+            throw new SQLException(CLOSED);
+        return prepareStatement(new PreparedStatementArgs(sql));
+    }
+
 }