diff options
author | Matthew Newhook <matthew@zeroc.com> | 2008-08-18 14:11:56 -0230 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2008-08-18 14:11:56 -0230 |
commit | 81092d2fedc964062ac30f03cad4bb6469aafa1b (patch) | |
tree | a442196a518fae1a1eaa2ff9185142a73460807f /java/demo/Database/library/ConnectionPool.java | |
parent | remove QueryActiveException. (diff) | |
download | ice-81092d2fedc964062ac30f03cad4bb6469aafa1b.tar.bz2 ice-81092d2fedc964062ac30f03cad4bb6469aafa1b.tar.xz ice-81092d2fedc964062ac30f03cad4bb6469aafa1b.zip |
SQL setup is now more automatic.
Diffstat (limited to 'java/demo/Database/library/ConnectionPool.java')
-rw-r--r-- | java/demo/Database/library/ConnectionPool.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/java/demo/Database/library/ConnectionPool.java b/java/demo/Database/library/ConnectionPool.java index 38eed101095..4e0b32f759a 100644 --- a/java/demo/Database/library/ConnectionPool.java +++ b/java/demo/Database/library/ConnectionPool.java @@ -21,7 +21,9 @@ class ConnectionPool _nconnections = numConnections; while(numConnections-- > 0) { - _connections.add(java.sql.DriverManager.getConnection (url, username, password)); + java.sql.Connection connection = java.sql.DriverManager.getConnection (url, username, password); + connection.setAutoCommit(false); + _connections.add(connection); } } @@ -100,6 +102,7 @@ class ConnectionPool try { conn = java.sql.DriverManager.getConnection (_url, _username, _password); + conn.setAutoCommit(false); } catch(java.sql.SQLException e) { |