Avoid reusing/rewriting the DB connection properties.
There was weird random errors while testing connection to multiple DB in parallel when one of them was meta connection to same DB connection.
Two kinds of exception: 1) missing password 2) „Passing DB password as CLI parameter is insecure!“
3 * Copyright © 2014 František Kučera (frantovo.cz)
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 package info.globalcode.jdbc.loopback;
20 import java.sql.SQLClientInfoException;
21 import java.sql.SQLException;
22 import java.sql.SQLWarning;
23 import java.sql.Savepoint;
25 import java.util.Properties;
26 import java.util.concurrent.Executor;
30 * @author Ing. František Kučera (frantovo.cz)
32 public class Connection extends AbstractConnection {
35 private Properties info;
37 public Connection(String url, Properties info) {
43 public java.sql.PreparedStatement prepareStatement(String sql) throws SQLException {
44 return new PreparedStatement();
48 public void setAutoCommit(boolean autoCommit) throws SQLException {
52 public boolean getAutoCommit() throws SQLException {
57 public void commit() throws SQLException {
61 public void rollback() throws SQLException {
65 public void close() throws SQLException {
69 public boolean isClosed() throws SQLException {
74 public void setReadOnly(boolean readOnly) throws SQLException {
78 public boolean isReadOnly() throws SQLException {
83 public void setCatalog(String catalog) throws SQLException {
87 public void setTransactionIsolation(int level) throws SQLException {
91 public SQLWarning getWarnings() throws SQLException {
96 public void clearWarnings() throws SQLException {
100 public void setTypeMap(Map<String, Class<?>> map) throws SQLException {
104 public void setHoldability(int holdability) throws SQLException {
108 public void rollback(Savepoint savepoint) throws SQLException {
112 public void releaseSavepoint(Savepoint savepoint) throws SQLException {
116 public boolean isValid(int timeout) throws SQLException {
121 public void setClientInfo(String name, String value) throws SQLClientInfoException {
125 public void setClientInfo(Properties properties) throws SQLClientInfoException {
129 public void abort(Executor executor) throws SQLException {
133 public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {