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

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

public final class DbPreparedStatement
extends java.lang.Object
implements de.uplanet.util.ICloseable

Version:
$Revision: 86207 $

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 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 setTimestamp(int p_iIdx, java.lang.Object p_value)
           
 void setTimestamp(int p_iIdx, java.lang.Object p_value, java.util.Calendar p_cal)
           
 
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
Throws:
java.sql.SQLException

executeUpdate

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

executeQuery

public DbResultSet executeQuery()
                         throws java.sql.SQLException
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.

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.

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.

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
Throws:
java.sql.SQLException

setInt

public void setInt(int p_iIdx,
                   java.lang.Object p_value)
            throws java.sql.SQLException
Throws:
java.sql.SQLException

setLong

public void setLong(int p_iIdx,
                    java.lang.Object p_value)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

setShort

public void setShort(int p_iIdx,
                     java.lang.Object p_value)
              throws java.sql.SQLException
Throws:
java.sql.SQLException

setByte

public void setByte(int p_iIdx,
                    java.lang.Object p_value)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

setBigDecimal

public void setBigDecimal(int p_iIdx,
                          java.lang.Object p_value)
                   throws java.sql.SQLException
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
Throws:
java.sql.SQLException

setDouble

public void setDouble(int p_iIdx,
                      java.lang.Object p_value)
               throws java.sql.SQLException
Throws:
java.sql.SQLException

setTimestamp

public void setTimestamp(int p_iIdx,
                         java.lang.Object p_value)
                  throws java.sql.SQLException
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
Throws:
java.sql.SQLException

setTime

public void setTime(int p_iIdx,
                    java.lang.Object p_value)
             throws java.sql.SQLException
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
Throws:
java.sql.SQLException

setDate

public void setDate(int p_iIdx,
                    java.lang.Object p_value)
             throws java.sql.SQLException
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
Throws:
java.sql.SQLException

setString

public void setString(int p_iIdx,
                      java.lang.Object p_value)
               throws java.sql.SQLException
Throws:
java.sql.SQLException

setCharacterStream

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

close

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

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


Last updated: 2011-01-27
Copyright 2000-2010 United Planet. All Rights Reserved.