java/jdbc-loopback-driver/src/info/globalcode/jdbc/loopback/AbstractPreparedStatement.java
author František Kučera <franta-hg@frantovo.cz>
Tue, 26 Feb 2019 18:19:49 +0100
branchv_0
changeset 236 a3ec71fa8e17
parent 171 701ec4db43fb
permissions -rw-r--r--
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!“
     1 /**
     2  * SQL-DK
     3  * Copyright © 2014 František Kučera (frantovo.cz)
     4  *
     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.
     9  *
    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.
    14  *
    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/>.
    17  */
    18 package info.globalcode.jdbc.loopback;
    19 
    20 import java.io.InputStream;
    21 import java.io.Reader;
    22 import java.math.BigDecimal;
    23 import java.net.URL;
    24 import java.sql.Array;
    25 import java.sql.Blob;
    26 import java.sql.Clob;
    27 import java.sql.Date;
    28 import java.sql.NClob;
    29 import java.sql.ParameterMetaData;
    30 import java.sql.Ref;
    31 import java.sql.ResultSet;
    32 import java.sql.ResultSetMetaData;
    33 import java.sql.RowId;
    34 import java.sql.SQLException;
    35 import java.sql.SQLXML;
    36 import java.sql.Time;
    37 import java.sql.Timestamp;
    38 import java.util.Calendar;
    39 
    40 /**
    41  *
    42  * @author Ing. František Kučera (frantovo.cz)
    43  */
    44 public abstract class AbstractPreparedStatement extends AbstractStatement implements java.sql.PreparedStatement {
    45 
    46 	@Override
    47 	public ResultSet executeQuery() throws SQLException {
    48 		throw new SQLException("Not supported yet.");
    49 	}
    50 
    51 	@Override
    52 	public int executeUpdate() throws SQLException {
    53 		throw new SQLException("Not supported yet.");
    54 	}
    55 
    56 	@Override
    57 	public void setNull(int parameterIndex, int sqlType) throws SQLException {
    58 		throw new SQLException("Not supported yet.");
    59 	}
    60 
    61 	@Override
    62 	public void setBoolean(int parameterIndex, boolean x) throws SQLException {
    63 		throw new SQLException("Not supported yet.");
    64 	}
    65 
    66 	@Override
    67 	public void setByte(int parameterIndex, byte x) throws SQLException {
    68 		throw new SQLException("Not supported yet.");
    69 	}
    70 
    71 	@Override
    72 	public void setShort(int parameterIndex, short x) throws SQLException {
    73 		throw new SQLException("Not supported yet.");
    74 	}
    75 
    76 	@Override
    77 	public void setInt(int parameterIndex, int x) throws SQLException {
    78 		throw new SQLException("Not supported yet.");
    79 	}
    80 
    81 	@Override
    82 	public void setLong(int parameterIndex, long x) throws SQLException {
    83 		throw new SQLException("Not supported yet.");
    84 	}
    85 
    86 	@Override
    87 	public void setFloat(int parameterIndex, float x) throws SQLException {
    88 		throw new SQLException("Not supported yet.");
    89 	}
    90 
    91 	@Override
    92 	public void setDouble(int parameterIndex, double x) throws SQLException {
    93 		throw new SQLException("Not supported yet.");
    94 	}
    95 
    96 	@Override
    97 	public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException {
    98 		throw new SQLException("Not supported yet.");
    99 	}
   100 
   101 	@Override
   102 	public void setString(int parameterIndex, String x) throws SQLException {
   103 		throw new SQLException("Not supported yet.");
   104 	}
   105 
   106 	@Override
   107 	public void setBytes(int parameterIndex, byte[] x) throws SQLException {
   108 		throw new SQLException("Not supported yet.");
   109 	}
   110 
   111 	@Override
   112 	public void setDate(int parameterIndex, Date x) throws SQLException {
   113 		throw new SQLException("Not supported yet.");
   114 	}
   115 
   116 	@Override
   117 	public void setTime(int parameterIndex, Time x) throws SQLException {
   118 		throw new SQLException("Not supported yet.");
   119 	}
   120 
   121 	@Override
   122 	public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException {
   123 		throw new SQLException("Not supported yet.");
   124 	}
   125 
   126 	@Override
   127 	public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException {
   128 		throw new SQLException("Not supported yet.");
   129 	}
   130 
   131 	@Override
   132 	@Deprecated
   133 	public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException {
   134 		throw new SQLException("Not supported yet.");
   135 	}
   136 
   137 	@Override
   138 	public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException {
   139 		throw new SQLException("Not supported yet.");
   140 	}
   141 
   142 	@Override
   143 	public void clearParameters() throws SQLException {
   144 		throw new SQLException("Not supported yet.");
   145 	}
   146 
   147 	@Override
   148 	public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException {
   149 		throw new SQLException("Not supported yet.");
   150 	}
   151 
   152 	@Override
   153 	public void setObject(int parameterIndex, Object x) throws SQLException {
   154 		throw new SQLException("Not supported yet.");
   155 	}
   156 
   157 	@Override
   158 	public boolean execute() throws SQLException {
   159 		throw new SQLException("Not supported yet.");
   160 	}
   161 
   162 	@Override
   163 	public void addBatch() throws SQLException {
   164 		throw new SQLException("Not supported yet.");
   165 	}
   166 
   167 	@Override
   168 	public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException {
   169 		throw new SQLException("Not supported yet.");
   170 	}
   171 
   172 	@Override
   173 	public void setRef(int parameterIndex, Ref x) throws SQLException {
   174 		throw new SQLException("Not supported yet.");
   175 	}
   176 
   177 	@Override
   178 	public void setBlob(int parameterIndex, Blob x) throws SQLException {
   179 		throw new SQLException("Not supported yet.");
   180 	}
   181 
   182 	@Override
   183 	public void setClob(int parameterIndex, Clob x) throws SQLException {
   184 		throw new SQLException("Not supported yet.");
   185 	}
   186 
   187 	@Override
   188 	public void setArray(int parameterIndex, Array x) throws SQLException {
   189 		throw new SQLException("Not supported yet.");
   190 	}
   191 
   192 	@Override
   193 	public ResultSetMetaData getMetaData() throws SQLException {
   194 		throw new SQLException("Not supported yet.");
   195 	}
   196 
   197 	@Override
   198 	public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException {
   199 		throw new SQLException("Not supported yet.");
   200 	}
   201 
   202 	@Override
   203 	public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException {
   204 		throw new SQLException("Not supported yet.");
   205 	}
   206 
   207 	@Override
   208 	public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException {
   209 		throw new SQLException("Not supported yet.");
   210 	}
   211 
   212 	@Override
   213 	public void setNull(int parameterIndex, int sqlType, String typeName) throws SQLException {
   214 		throw new SQLException("Not supported yet.");
   215 	}
   216 
   217 	@Override
   218 	public void setURL(int parameterIndex, URL x) throws SQLException {
   219 		throw new SQLException("Not supported yet.");
   220 	}
   221 
   222 	@Override
   223 	public ParameterMetaData getParameterMetaData() throws SQLException {
   224 		throw new SQLException("Not supported yet.");
   225 	}
   226 
   227 	@Override
   228 	public void setRowId(int parameterIndex, RowId x) throws SQLException {
   229 		throw new SQLException("Not supported yet.");
   230 	}
   231 
   232 	@Override
   233 	public void setNString(int parameterIndex, String value) throws SQLException {
   234 		throw new SQLException("Not supported yet.");
   235 	}
   236 
   237 	@Override
   238 	public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException {
   239 		throw new SQLException("Not supported yet.");
   240 	}
   241 
   242 	@Override
   243 	public void setNClob(int parameterIndex, NClob value) throws SQLException {
   244 		throw new SQLException("Not supported yet.");
   245 	}
   246 
   247 	@Override
   248 	public void setClob(int parameterIndex, Reader reader, long length) throws SQLException {
   249 		throw new SQLException("Not supported yet.");
   250 	}
   251 
   252 	@Override
   253 	public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException {
   254 		throw new SQLException("Not supported yet.");
   255 	}
   256 
   257 	@Override
   258 	public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException {
   259 		throw new SQLException("Not supported yet.");
   260 	}
   261 
   262 	@Override
   263 	public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException {
   264 		throw new SQLException("Not supported yet.");
   265 	}
   266 
   267 	@Override
   268 	public void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) throws SQLException {
   269 		throw new SQLException("Not supported yet.");
   270 	}
   271 
   272 	@Override
   273 	public void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException {
   274 		throw new SQLException("Not supported yet.");
   275 	}
   276 
   277 	@Override
   278 	public void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException {
   279 		throw new SQLException("Not supported yet.");
   280 	}
   281 
   282 	@Override
   283 	public void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException {
   284 		throw new SQLException("Not supported yet.");
   285 	}
   286 
   287 	@Override
   288 	public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException {
   289 		throw new SQLException("Not supported yet.");
   290 	}
   291 
   292 	@Override
   293 	public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException {
   294 		throw new SQLException("Not supported yet.");
   295 	}
   296 
   297 	@Override
   298 	public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException {
   299 		throw new SQLException("Not supported yet.");
   300 	}
   301 
   302 	@Override
   303 	public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException {
   304 		throw new SQLException("Not supported yet.");
   305 	}
   306 
   307 	@Override
   308 	public void setClob(int parameterIndex, Reader reader) throws SQLException {
   309 		throw new SQLException("Not supported yet.");
   310 	}
   311 
   312 	@Override
   313 	public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException {
   314 		throw new SQLException("Not supported yet.");
   315 	}
   316 
   317 	@Override
   318 	public void setNClob(int parameterIndex, Reader reader) throws SQLException {
   319 		throw new SQLException("Not supported yet.");
   320 	}
   321 
   322 }