1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370
|
/*-------------------------------------------------------------------------
*
* Copyright (c) 2004-2008, PostgreSQL Global Development Group
*
* IDENTIFICATION
* $PostgreSQL: pgjdbc/org/postgresql/jdbc4/AbstractJdbc4Statement.java,v 1.5 2008/10/08 18:24:05 jurka Exp $
*
*-------------------------------------------------------------------------
*/
package org.postgresql.jdbc4;
import java.sql.*;
import java.io.Reader;
import java.io.InputStream;
import org.postgresql.core.Oid;
abstract class AbstractJdbc4Statement extends org.postgresql.jdbc3g.AbstractJdbc3gStatement
{
private boolean poolable;
AbstractJdbc4Statement (Jdbc4Connection c, int rsType, int rsConcurrency, int rsHoldability) throws SQLException
{
super(c, rsType, rsConcurrency, rsHoldability);
poolable = true;
}
public AbstractJdbc4Statement(Jdbc4Connection connection, String sql, boolean isCallable, int rsType, int rsConcurrency, int rsHoldability) throws SQLException
{
super(connection, sql, isCallable, rsType, rsConcurrency, rsHoldability);
}
public boolean isClosed() throws SQLException
{
return isClosed;
}
public void setObject(int parameterIndex, Object x) throws SQLException
{
if (x instanceof SQLXML)
{
setSQLXML(parameterIndex, (SQLXML)x);
} else {
super.setObject(parameterIndex, x);
}
}
public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException
{
checkClosed();
if (x == null)
{
setNull(parameterIndex, targetSqlType);
return;
}
switch (targetSqlType) {
case Types.SQLXML:
if (x instanceof SQLXML) {
setSQLXML(parameterIndex, (SQLXML)x);
} else {
setSQLXML(parameterIndex, new Jdbc4SQLXML(connection, x.toString()));
}
break;
default:
super.setObject(parameterIndex, x, targetSqlType, scale);
}
}
public void setNull(int parameterIndex, int targetSqlType) throws SQLException
{
checkClosed();
int oid;
switch (targetSqlType)
{
case Types.SQLXML:
oid = Oid.XML;
break;
default:
super.setNull(parameterIndex, targetSqlType);
return;
}
if (adjustIndex)
parameterIndex--;
preparedParameters.setNull(parameterIndex, oid);
}
public void setRowId(int parameterIndex, RowId x) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setRowId(int, RowId)");
}
public void setNString(int parameterIndex, String value) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setNString(int, String)");
}
public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setNCharacterStream(int, Reader, long)");
}
public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setNCharacterStream(int, Reader)");
}
public void setCharacterStream(int parameterIndex, Reader value, long length) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setCharacterStream(int, Reader, long)");
}
public void setCharacterStream(int parameterIndex, Reader value) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setCharacterStream(int, Reader)");
}
public void setBinaryStream(int parameterIndex, InputStream value, long length) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setBinaryStream(int, InputStream, long)");
}
public void setBinaryStream(int parameterIndex, InputStream value) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setBinaryStream(int, InputStream)");
}
public void setAsciiStream(int parameterIndex, InputStream value, long length) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setAsciiStream(int, InputStream, long)");
}
public void setAsciiStream(int parameterIndex, InputStream value) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setAsciiStream(int, InputStream)");
}
public void setNClob(int parameterIndex, NClob value) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setNClob(int, NClob)");
}
public void setClob(int parameterIndex, Reader reader, long length) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setClob(int, Reader, long)");
}
public void setClob(int parameterIndex, Reader reader) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setClob(int, Reader)");
}
public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setBlob(int, InputStream, long)");
}
public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setBlob(int, InputStream)");
}
public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setNClob(int, Reader, long)");
}
public void setNClob(int parameterIndex, Reader reader) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setNClob(int, Reader)");
}
public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException
{
checkClosed();
if (xmlObject == null || xmlObject.getString() == null)
setNull(parameterIndex, Types.SQLXML);
else
setString(parameterIndex, xmlObject.getString(), Oid.XML);
}
public void setPoolable(boolean poolable) throws SQLException
{
checkClosed();
this.poolable = poolable;
}
public boolean isPoolable() throws SQLException
{
checkClosed();
return poolable;
}
public RowId getRowId(int parameterIndex) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "getRowId(int)");
}
public RowId getRowId(String parameterName) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "getRowId(String)");
}
public void setRowId(String parameterName, RowId x) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setRowId(String, RowId)");
}
public void setNString(String parameterName, String value) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setNString(String, String)");
}
public void setNCharacterStream(String parameterName, Reader value, long length) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setNCharacterStream(String, Reader, long)");
}
public void setNCharacterStream(String parameterName, Reader value) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setNCharacterStream(String, Reader)");
}
public void setCharacterStream(String parameterName, Reader value, long length) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setCharacterStream(String, Reader, long)");
}
public void setCharacterStream(String parameterName, Reader value) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setCharacterStream(String, Reader)");
}
public void setBinaryStream(String parameterName, InputStream value, long length) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setBinaryStream(String, InputStream, long)");
}
public void setBinaryStream(String parameterName, InputStream value) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setBinaryStream(String, InputStream)");
}
public void setAsciiStream(String parameterName, InputStream value, long length) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setAsciiStream(String, InputStream, long)");
}
public void setAsciiStream(String parameterName, InputStream value) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setAsciiStream(String, InputStream)");
}
public void setNClob(String parameterName, NClob value) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setNClob(String, NClob)");
}
public void setClob(String parameterName, Reader reader, long length) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setClob(String, Reader, long)");
}
public void setClob(String parameterName, Reader reader) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setClob(String, Reader)");
}
public void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setBlob(String, InputStream, long)");
}
public void setBlob(String parameterName, InputStream inputStream) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setBlob(String, InputStream)");
}
public void setNClob(String parameterName, Reader reader, long length) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setNClob(String, Reader, long)");
}
public void setNClob(String parameterName, Reader reader) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setNClob(String, Reader)");
}
public NClob getNClob(int parameterIndex) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "getNClob(int)");
}
public NClob getNClob(String parameterName) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "getNClob(String)");
}
public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setSQLXML(String, SQLXML)");
}
public SQLXML getSQLXML(int parameterIndex) throws SQLException
{
checkClosed();
checkIndex(parameterIndex, Types.SQLXML, "SQLXML");
return (SQLXML)callResult[parameterIndex - 1];
}
public SQLXML getSQLXML(String parameterIndex) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "getSQLXML(String)");
}
public String getNString(int parameterIndex) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "getNString(int)");
}
public String getNString(String parameterName) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "getNString(String)");
}
public Reader getNCharacterStream(int parameterIndex) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "getNCharacterStream(int)");
}
public Reader getNCharacterStream(String parameterName) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "getNCharacterStream(String)");
}
public Reader getCharacterStream(int parameterIndex) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "getCharacterStream(int)");
}
public Reader getCharacterStream(String parameterName) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "getCharacterStream(String)");
}
public void setBlob(String parameterName, Blob x) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setBlob(String, Blob)");
}
public void setClob(String parameterName, Clob x) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "setClob(String, Clob)");
}
public boolean isWrapperFor(Class<?> iface) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "isWrapperFor(Class<?>)");
}
public <T> T unwrap(Class<T> iface) throws SQLException
{
throw org.postgresql.Driver.notImplemented(this.getClass(), "unwrap(Class<T>)");
}
}
|