de.uplanet.lucy.server.util.db
Class DbPreparedStatement

java.lang.Object
  extended by de.uplanet.lucy.server.util.db.DbPreparedStatement
All Implemented Interfaces:
IDbPreparedStatement, ICloseable

public final class DbPreparedStatement
extends java.lang.Object
implements IDbPreparedStatement

Version:
$Revision: 90035 $

Method Summary
 void close()
          Close this statement.
 void execute()
           
 java.lang.Object executeAndGetScalarValue()
          Get the value of the first column in the first row of the result set.
 java.lang.Object executeAndGetScalarValue(java.lang.Object p_valueFallback)
          Get the value of the first column in the first row of the result set.
 IValueHolder<?> executeAndGetScalarValueHolder()
          Get the value of the first column in the first row of the result set.
 DbResultSet executeQuery()
           
 int executeUpdate()
           
 void setBigDecimal(int p_iIdx, java.lang.Object p_value)
           
 void setBoolean(int p_iIdx, java.lang.Object p_value)
           
 void setByte(int p_iIdx, java.lang.Object p_value)
           
 void setCharacterStream(int p_iIdx, java.lang.Object p_value)
           
 void setDate(int p_iIdx, java.lang.Object p_value)
           
 void setDate(int p_iIdx, java.lang.Object p_value, java.util.Calendar p_cal)
           
 void setDate(int p_iIdx, java.lang.Object p_value, java.util.TimeZone p_tz)
           
 void setDecimal(int p_iIdx, java.lang.Object p_value)
          Deprecated. Use setBigDecimal(int, Object) instead.
 void setDouble(int p_iIdx, java.lang.Object p_value)
           
 void setFloat(int p_iIdx, java.lang.Object p_value)
           
 void setInt(int p_iIdx, java.lang.Object p_value)
           
 void setLong(int p_iIdx, java.lang.Object p_value)
           
 void setShort(int p_iIdx, java.lang.Object p_value)
           
 void setString(int p_iIdx, java.lang.Object p_value)
           
 void setTime(int p_iIdx, java.lang.Object p_value)
           
 void setTime(int p_iIdx, java.lang.Object p_value, java.util.Calendar p_cal)
           
 void setTime(int p_iIdx, java.lang.Object p_value, java.util.TimeZone p_tz)
           
 void setTimestamp(int p_iIdx, java.lang.Object p_value)
           
 void setTimestamp(int p_iIdx, java.lang.Object p_value, java.util.Calendar p_cal)
           
 void setTimestamp(int p_iIdx, java.lang.Object p_value, java.util.TimeZone p_tz)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

execute

public void execute()
             throws java.sql.SQLException
Specified by:
execute in interface IDbPreparedStatement
Throws:
java.sql.SQLException

executeUpdate

public int executeUpdate()
                  throws java.sql.SQLException
Specified by:
executeUpdate in interface IDbPreparedStatement
Throws:
java.sql.SQLException

executeQuery

public DbResultSet executeQuery()
                         throws java.sql.SQLException
Specified by:
executeQuery in interface IDbPreparedStatement
Throws:
java.sql.SQLException

executeAndGetScalarValueHolder

public IValueHolder<?> executeAndGetScalarValueHolder()
                                               throws java.sql.SQLException
Get the value of the first column in the first row of the result set.

If the result set is empty, null is returned.

Specified by:
executeAndGetScalarValueHolder in interface IDbPreparedStatement
Returns:
A value holder that contains the value of the first column in the first row of the result set, or null if the result set is empty.
Throws:
java.sql.SQLException

executeAndGetScalarValue

public java.lang.Object executeAndGetScalarValue(java.lang.Object p_valueFallback)
                                          throws java.sql.SQLException
Get the value of the first column in the first row of the result set.

If the result set is empty, or the value is null, p_valueIfNull is returned.

Specified by:
executeAndGetScalarValue in interface IDbPreparedStatement
Parameters:
p_valueFallback - The return value if the query returns an empty result set or null.
Returns:
The value of the first column in the first row of the result set, or p_valueIfNull if the result set is empty, or the value is null.
Throws:
java.sql.SQLException

executeAndGetScalarValue

public java.lang.Object executeAndGetScalarValue()
                                          throws java.sql.SQLException
Get the value of the first column in the first row of the result set.

If the result set is empty, null is returned.

Specified by:
executeAndGetScalarValue in interface IDbPreparedStatement
Returns:
The value of the first column in the first row of the result set, or null if the result set is empty.
Throws:
java.sql.SQLException

setBoolean

public void setBoolean(int p_iIdx,
                       java.lang.Object p_value)
                throws java.sql.SQLException
Specified by:
setBoolean in interface IDbPreparedStatement
Throws:
java.sql.SQLException

setInt

public void setInt(int p_iIdx,
                   java.lang.Object p_value)
            throws java.sql.SQLException
Specified by:
setInt in interface IDbPreparedStatement
Throws:
java.sql.SQLException

setLong

public void setLong(int p_iIdx,
                    java.lang.Object p_value)
             throws java.sql.SQLException
Specified by:
setLong in interface IDbPreparedStatement
Throws:
java.sql.SQLException

setShort

public void setShort(int p_iIdx,
                     java.lang.Object p_value)
              throws java.sql.SQLException
Specified by:
setShort in interface IDbPreparedStatement
Throws:
java.sql.SQLException

setByte

public void setByte(int p_iIdx,
                    java.lang.Object p_value)
             throws java.sql.SQLException
Specified by:
setByte in interface IDbPreparedStatement
Throws:
java.sql.SQLException

setBigDecimal

public void setBigDecimal(int p_iIdx,
                          java.lang.Object p_value)
                   throws java.sql.SQLException
Specified by:
setBigDecimal in interface IDbPreparedStatement
Throws:
java.sql.SQLException

setDecimal

@Deprecated
public void setDecimal(int p_iIdx,
                                  java.lang.Object p_value)
Deprecated. Use setBigDecimal(int, Object) instead.


setFloat

public void setFloat(int p_iIdx,
                     java.lang.Object p_value)
              throws java.sql.SQLException
Specified by:
setFloat in interface IDbPreparedStatement
Throws:
java.sql.SQLException

setDouble

public void setDouble(int p_iIdx,
                      java.lang.Object p_value)
               throws java.sql.SQLException
Specified by:
setDouble in interface IDbPreparedStatement
Throws:
java.sql.SQLException

setTimestamp

public void setTimestamp(int p_iIdx,
                         java.lang.Object p_value)
                  throws java.sql.SQLException
Specified by:
setTimestamp in interface IDbPreparedStatement
Throws:
java.sql.SQLException

setTimestamp

public void setTimestamp(int p_iIdx,
                         java.lang.Object p_value,
                         java.util.TimeZone p_tz)
                  throws java.sql.SQLException
Specified by:
setTimestamp in interface IDbPreparedStatement
Throws:
java.sql.SQLException

setTimestamp

public void setTimestamp(int p_iIdx,
                         java.lang.Object p_value,
                         java.util.Calendar p_cal)
                  throws java.sql.SQLException
Specified by:
setTimestamp in interface IDbPreparedStatement
Throws:
java.sql.SQLException

setTime

public void setTime(int p_iIdx,
                    java.lang.Object p_value)
             throws java.sql.SQLException
Specified by:
setTime in interface IDbPreparedStatement
Throws:
java.sql.SQLException

setTime

public void setTime(int p_iIdx,
                    java.lang.Object p_value,
                    java.util.TimeZone p_tz)
             throws java.sql.SQLException
Specified by:
setTime in interface IDbPreparedStatement
Throws:
java.sql.SQLException

setTime

public void setTime(int p_iIdx,
                    java.lang.Object p_value,
                    java.util.Calendar p_cal)
             throws java.sql.SQLException
Specified by:
setTime in interface IDbPreparedStatement
Throws:
java.sql.SQLException

setDate

public void setDate(int p_iIdx,
                    java.lang.Object p_value)
             throws java.sql.SQLException
Specified by:
setDate in interface IDbPreparedStatement
Throws:
java.sql.SQLException

setDate

public void setDate(int p_iIdx,
                    java.lang.Object p_value,
                    java.util.TimeZone p_tz)
             throws java.sql.SQLException
Specified by:
setDate in interface IDbPreparedStatement
Throws:
java.sql.SQLException

setDate

public void setDate(int p_iIdx,
                    java.lang.Object p_value,
                    java.util.Calendar p_cal)
             throws java.sql.SQLException
Specified by:
setDate in interface IDbPreparedStatement
Throws:
java.sql.SQLException

setString

public void setString(int p_iIdx,
                      java.lang.Object p_value)
               throws java.sql.SQLException
Specified by:
setString in interface IDbPreparedStatement
Throws:
java.sql.SQLException

setCharacterStream

public void setCharacterStream(int p_iIdx,
                               java.lang.Object p_value)
                        throws java.sql.SQLException,
                               java.io.IOException
Specified by:
setCharacterStream in interface IDbPreparedStatement
Throws:
java.sql.SQLException
java.io.IOException

close

public void close()
           throws java.sql.SQLException
Close this statement.

Specified by:
close in interface IDbPreparedStatement
Specified by:
close in interface ICloseable
Throws:
java.sql.SQLException - If a database error occurred.


Last updated: 2011-08-11 10-04
Copyright © 2000-2011 United Planet. All Rights Reserved.