com.partnersoft.sql
Class SqlPreparedStatement

java.lang.Object
  extended by com.partnersoft.sql.SqlPreparedStatement

public class SqlPreparedStatement
extends java.lang.Object

A wrapper around java.sql.PreparedStatement that tracks the names of the values specified as ?, and allows you to set them using a Naming or CogHeader.

Copyright 2009 Partner Software, Inc.

Version:
$Id$
Author:
Paul Reavis

Constructor Summary
SqlPreparedStatement(SqlConnection connection, java.lang.String sql, java.util.List<java.lang.String> fieldNames)
           
SqlPreparedStatement(SqlConnection connection, java.lang.String sql, java.lang.String... fieldNames)
           
 
Method Summary
 void close()
           
 SqlDataRecordSource executeQuery()
           
 int executeUpdate()
           
 java.util.List<java.lang.String> getFieldNames()
           
 java.lang.String getSql()
           
 java.sql.PreparedStatement getStatement()
           
 void setValues(Cog values)
           
 void setValues(Naming values)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SqlPreparedStatement

public SqlPreparedStatement(SqlConnection connection,
                            java.lang.String sql,
                            java.lang.String... fieldNames)
                     throws java.sql.SQLException
Throws:
java.sql.SQLException

SqlPreparedStatement

public SqlPreparedStatement(SqlConnection connection,
                            java.lang.String sql,
                            java.util.List<java.lang.String> fieldNames)
                     throws java.sql.SQLException
Throws:
java.sql.SQLException
Method Detail

setValues

public void setValues(Naming values)
               throws java.sql.SQLException
Throws:
java.sql.SQLException

setValues

public void setValues(Cog values)
               throws java.sql.SQLException
Throws:
java.sql.SQLException

executeUpdate

public int executeUpdate()
                  throws java.sql.SQLException
Throws:
java.sql.SQLException

executeQuery

public SqlDataRecordSource executeQuery()
                                 throws java.sql.SQLException
Throws:
java.sql.SQLException

close

public void close()
           throws java.sql.SQLException
Throws:
java.sql.SQLException

getSql

public java.lang.String getSql()

getStatement

public java.sql.PreparedStatement getStatement()

getFieldNames

public java.util.List<java.lang.String> getFieldNames()