FileDocCategorySizeDatePackage
PreparedStatementImpl.javaAPI DocGlassfish v2 API15237Fri May 04 22:35:02 BST 2007com.sun.jdo.spi.persistence.support.sqlstore.connection

PreparedStatementImpl

public class PreparedStatementImpl extends StatementImpl implements PreparedStatement
This class implements the java.sql.PreparedStatement interface, which is part of the JDBC API. You should use the java.sql.PreparedStatement interface as an object type instead of this class.

Fields Summary
Constructors Summary
public PreparedStatementImpl()

        super();
        this.conn = null;
        this.stmt = null;
    
public PreparedStatementImpl(ConnectionImpl conn, PreparedStatement pstmt)

        super();
        this.conn = conn;
        this.stmt = (Statement) pstmt;
    
Methods Summary
public voidaddBatch()

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        try {
            pstmt.addBatch();
        } catch (SQLException se) {
            throw se;
        }
    
public voidclearParameters()

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        try {
            pstmt.clearParameters();
        } catch (SQLException se) {
            throw se;
        }
    
public booleanexecute()

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        try {
            this.conn.checkXact();
            return (pstmt.execute());
        } catch (SQLException se) {
            throw se;
        }
    
public java.sql.ResultSetexecuteQuery()

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        try {
            this.conn.checkXact();
            return (pstmt.executeQuery());
        } catch (SQLException se) {
            throw se;
        }
    
public intexecuteUpdate()

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        try {
            this.conn.checkXact();
            return (pstmt.executeUpdate());
        } catch (SQLException se) {
            throw se;
        }
    
public java.sql.ArraygetArray(int i)

        return (null);
    
public java.sql.BlobgetBlob(int i)

        return (null);
    
public java.sql.ClobgetClob(int i)

        return (null);
    
public java.sql.DategetDate(int parameterIndex, java.util.Calendar cal)

        return (null);
    
public java.sql.ResultSetMetaDatagetMetaData()

        return (null);
    
public java.sql.ParameterMetaDatagetParameterMetaData()


        throw new UnsupportedOperationException();
    
public java.sql.TimegetTime(int parameterIndex, java.util.Calendar cal)

        return (null);
    
public java.sql.TimestampgetTimestamp(int parameterIndex, java.util.Calendar cal)

        return (null);
    
public voidsetArray(int i, java.sql.Array x)

    
public voidsetAsciiStream(int parameterIndex, java.io.InputStream x, int length)

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        try {
            pstmt.setAsciiStream(parameterIndex, x, length);
        } catch (SQLException se) {
            throw se;
        }
    
public voidsetBigDecimal(int parameterIndex, java.math.BigDecimal x)

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        try {
            pstmt.setBigDecimal(parameterIndex, x);
        } catch (SQLException se) {
            throw se;
        }
    
public voidsetBinaryStream(int parameterIndex, java.io.InputStream x, int length)

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        try {
            pstmt.setBinaryStream(parameterIndex, x, length);
        } catch (SQLException se) {
            throw se;
        }
    
public voidsetBlob(int i, java.sql.Blob x)

    
public voidsetBoolean(int parameterIndex, boolean x)

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        try {
            pstmt.setBoolean(parameterIndex, x);
        } catch (SQLException se) {
            throw se;
        }
    
public voidsetByte(int parameterIndex, byte x)

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        try {
            pstmt.setByte(parameterIndex, x);
        } catch (SQLException se) {
            throw se;
        }
    
public voidsetBytes(int parameterIndex, byte[] x)

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        try {
            pstmt.setBytes(parameterIndex, x);
        } catch (SQLException se) {
            throw se;
        }
    
public voidsetCharacterStream(int parameterIndex, java.io.Reader reader, int length)

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        try {
            pstmt.setCharacterStream(parameterIndex, reader, length);
        } catch (SQLException se) {
            throw se;
        }
    
public voidsetClob(int i, java.sql.Clob x)

    
public voidsetDate(int parameterIndex, java.sql.Date x)

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        try {
            pstmt.setDate(parameterIndex, x);
        } catch (SQLException se) {
            throw se;
        }
    
public voidsetDate(int parameterIndex, java.sql.Date x, java.util.Calendar cal)

    
public voidsetDouble(int parameterIndex, double x)

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        try {
            pstmt.setDouble(parameterIndex, x);
        } catch (SQLException se) {
            throw se;
        }
    
public voidsetFloat(int parameterIndex, float x)

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        try {
            pstmt.setFloat(parameterIndex, x);
        } catch (SQLException se) {
            throw se;
        }
    
public voidsetInt(int parameterIndex, int x)

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        try {
            pstmt.setInt(parameterIndex, x);
        } catch (SQLException se) {
            throw se;
        }
    
public voidsetLong(int parameterIndex, long x)

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        try {
            pstmt.setLong(parameterIndex, x);
        } catch (SQLException se) {
            throw se;
        }
    
public voidsetNull(int i, int j, java.lang.String str)

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        /* Comment out for now.
		try
		{
			pstmt.setNull(i, j, str);
		}
		catch (SQLException se)
		{
			throw se;
		}
		*/
    
public voidsetNull(int parameterIndex, int sqlType)

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        try {
            pstmt.setNull(parameterIndex, sqlType);
        } catch (SQLException se) {
            throw se;
        }
    
public voidsetObject(int parameterIndex, java.lang.Object x, int targetSqlType, int scale)

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        try {
            pstmt.setObject(parameterIndex, x, targetSqlType, scale);
        } catch (SQLException se) {
            throw se;
        }
    
public voidsetObject(int parameterIndex, java.lang.Object x, int targetSqlType)

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        try {
            pstmt.setObject(parameterIndex, x, targetSqlType);
        } catch (SQLException se) {
            throw se;
        }
    
public voidsetObject(int parameterIndex, java.lang.Object x)

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        try {
            pstmt.setObject(parameterIndex, x);
        } catch (SQLException se) {
            throw se;
        }
    
public voidsetRef(int i, java.sql.Ref x)

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        try {
            pstmt.setRef(i, x);
        } catch (SQLException se) {
            throw se;
        }
    
public voidsetShort(int parameterIndex, short x)

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        try {
            pstmt.setShort(parameterIndex, x);
        } catch (SQLException se) {
            throw se;
        }
    
public voidsetString(int parameterIndex, java.lang.String x)

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        try {
            pstmt.setString(parameterIndex, x);
        } catch (SQLException se) {
            throw se;
        }
    
public voidsetTime(int parameterIndex, java.sql.Time x)

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        try {
            pstmt.setTime(parameterIndex, x);
        } catch (SQLException se) {
            throw se;
        }
    
public voidsetTime(int parameterIndex, java.sql.Time x, java.util.Calendar cal)

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        try {
            pstmt.setTime(parameterIndex, x);
        } catch (SQLException se) {
            throw se;
        }
    
public voidsetTimestamp(int parameterIndex, java.sql.Timestamp x)

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        try {
            pstmt.setTimestamp(parameterIndex, x);
        } catch (SQLException se) {
            throw se;
        }
    
public voidsetTimestamp(int parameterIndex, java.sql.Timestamp x, java.util.Calendar cal)

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        try {
            pstmt.setTimestamp(parameterIndex, x);
        } catch (SQLException se) {
            throw se;
        }
    
public voidsetURL(int parameterIndex, java.net.URL x)

        throw new UnsupportedOperationException();
    
public voidsetUnicodeStream(int parameterIndex, java.io.InputStream x, int length)

deprecated

        PreparedStatement pstmt = (PreparedStatement) this.stmt;

        try {
            pstmt.setUnicodeStream(parameterIndex, x, length);
        } catch (SQLException se) {
            throw se;
        }