|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.paris.lutece.util.sql.DAOUtil
public class DAOUtil
Prepared statement util class
Field Summary | |
---|---|
static java.lang.String |
MSG_EXCEPTION_SELECT_ERROR
|
Constructor Summary | |
---|---|
DAOUtil(java.lang.String sql)
Creates a new DAOUtil object. |
|
DAOUtil(java.lang.String strSQL,
Plugin plugin)
Creates a new DAOUtil object. |
Method Summary | |
---|---|
void |
executeQuery()
Executes a query |
void |
executeUpdate()
Executes the update request and throws an error if the result is not 1 |
protected void |
finalize()
finalize implementation |
boolean |
first()
Deprecated. |
void |
free()
Free connection |
java.io.InputStream |
getBinaryStream(int nIndex)
Gets a binary stream from a resultSet |
java.sql.Blob |
getBlob(int nIndex)
Gets a blob from a resultset |
java.sql.Blob |
getBlob(java.lang.String strColumnName)
Gets a blob from a resultset |
boolean |
getBoolean(int nIndex)
Gets the value of the designated column in the current row of this ResultSet object as a Boolean |
boolean |
getBoolean(java.lang.String strColumnName)
Gets the value of the designated column in the current row of this ResultSet object as a Boolean |
byte[] |
getBytes(int nIndex)
Gets a byte array from a resultset |
byte[] |
getBytes(java.lang.String strColumnName)
Gets a byte array from a resultset |
java.sql.Date |
getDate(int nIndex)
Gets the value of the designated column in the current row of this ResultSet object as a java.sql.Date object in the Java programming language. |
java.sql.Date |
getDate(java.lang.String strColumnName)
Gets the value of the designated column in the current row of this ResultSet object as a java.sql.Date object in the Java programming language. |
double |
getDouble(int nIndex)
Gets the value of the designated column in the current row of this ResultSet object as a double |
double |
getDouble(java.lang.String strColumnName)
Gets the value of the designated column in the current row of this ResultSet object as a double |
int |
getInt(int nIndex)
Gets the value of the designated column in the current row of this ResultSet object as a int |
int |
getInt(java.lang.String strColumnName)
Gets the value of the designated column in the current row of this ResultSet object as a int |
java.lang.Object |
getObject(int nIndex)
Gets the value of the designated column in the current row of this ResultSet object as a Object |
java.lang.Object |
getObject(java.lang.String strColumnName)
Gets the value of the designated column in the current row of this ResultSet object as an Object |
java.sql.ResultSet |
getResultSet()
Get the ResultSet |
java.lang.String |
getString(int nIndex)
Gets the value of the designated column in the current row of this ResultSet object as a string |
java.lang.String |
getString(java.lang.String strColumnName)
Gets the value of the designated column in the current row of this ResultSet object as a string |
java.sql.Time |
getTime(int nIndex)
Gets the value of the designated column in the current row of this ResultSet object as a java.sql.Time object in the Java programming language. |
java.sql.Time |
getTime(java.lang.String strColumnName)
Gets the value of the designated column in the current row of this ResultSet object as a java.sql.Time object in the Java programming language. |
java.sql.Timestamp |
getTimestamp(int nIndex)
Gets the value of the designated column in the current row of this ResultSet object as a timestamp |
java.sql.Timestamp |
getTimestamp(java.lang.String strColumnName)
Gets the value of the designated column in the current row of this ResultSet object as a Timestamp |
boolean |
isLast()
Indicates whether the cursor is on the last row of this ResultSet object. |
boolean |
next()
Moves the cursor down one row from its current position in the ResultSet. |
void |
setBinaryStream(int nIndex,
java.io.InputStream iStream,
int nBlength)
Fills the prepared statement with a binary value stream |
void |
setBoolean(int nIndex,
boolean bValue)
Fills the prepared statement with a Boolean value |
void |
setBytes(int nIndex,
byte[] tbValue)
Fills the prepared statement with a byte array value |
void |
setDate(int nIndex,
java.sql.Date date)
Fills the prepared statement with a date value |
void |
setDouble(int nIndex,
double dValue)
Fills the prepared statement with a double value |
void |
setInt(int nIndex,
int nValue)
Fills the prepared statement with a int value |
void |
setIntNull(int nIndex)
Fills the prepared statement with a int null value |
void |
setString(int nIndex,
java.lang.String strValue)
Fills the prepared statement with a string value |
void |
setTime(int nIndex,
java.sql.Time time)
Fills the prepared statement with a time value |
void |
setTimestamp(int nIndex,
java.sql.Timestamp ts)
Fills the prepared statement with a timestamp value |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String MSG_EXCEPTION_SELECT_ERROR
Constructor Detail |
---|
public DAOUtil(java.lang.String sql)
sql
- Sql Query for prepared Statementpublic DAOUtil(java.lang.String strSQL, Plugin plugin)
strSQL
- sql query for prepared Statementplugin
- The plugin using this database accessMethod Detail |
---|
public void executeUpdate()
public void executeQuery()
public void free()
public boolean first()
public boolean isLast()
public void setDate(int nIndex, java.sql.Date date)
nIndex
- parameter indexdate
- date valuepublic void setTime(int nIndex, java.sql.Time time)
nIndex
- parameter indextime
- time valuepublic void setBinaryStream(int nIndex, java.io.InputStream iStream, int nBlength)
nIndex
- parameter indexiStream
- the java input stream which contains the binary parameter valuenBlength
- the number of bytes in the streampublic java.io.InputStream getBinaryStream(int nIndex)
nIndex
- column index
public java.sql.Blob getBlob(int nIndex)
nIndex
- column index
public java.sql.Blob getBlob(java.lang.String strColumnName)
strColumnName
- column name
public byte[] getBytes(int nIndex)
nIndex
- column index
public byte[] getBytes(java.lang.String strColumnName)
strColumnName
- column name
public void setInt(int nIndex, int nValue)
nIndex
- parameter index in the prepared statementnValue
- int valuepublic void setBoolean(int nIndex, boolean bValue)
nIndex
- parameter index in the prepared statementbValue
- Boolean valuepublic void setBytes(int nIndex, byte[] tbValue)
nIndex
- parameter index in the prepared statementtbValue
- byte array valuepublic void setString(int nIndex, java.lang.String strValue)
nIndex
- parameter index in the prepared statementstrValue
- string valuepublic void setTimestamp(int nIndex, java.sql.Timestamp ts)
nIndex
- parameter index in the prepared statementts
- timestamp valuepublic void setDouble(int nIndex, double dValue)
nIndex
- parameter index in the prepared statementdValue
- The valuepublic java.sql.Date getDate(int nIndex)
nIndex
- the first column is 1, the second is 2, ...
public java.sql.Date getDate(java.lang.String strColumnName)
strColumnName
- name of the column, ...
public java.sql.Time getTime(int nIndex)
nIndex
- the first column is 1, the second is 2, ...
public java.sql.Time getTime(java.lang.String strColumnName)
strColumnName
- name of the column, ...
public int getInt(int nIndex)
nIndex
- the first column is 1, the second is 2, ...
public int getInt(java.lang.String strColumnName)
strColumnName
- column name
public boolean getBoolean(int nIndex)
nIndex
- the first column is 1, the second is 2, ...
public boolean getBoolean(java.lang.String strColumnName)
strColumnName
- column name
public java.lang.String getString(int nIndex)
nIndex
- the first column is 1, the second is 2, ...
public java.lang.String getString(java.lang.String strColumnName)
strColumnName
- column name
public java.sql.Timestamp getTimestamp(int nIndex)
nIndex
- the first column is 1, the second is 2, ...
public java.sql.Timestamp getTimestamp(java.lang.String strColumnName)
strColumnName
- column name
public double getDouble(java.lang.String strColumnName)
strColumnName
- column name
public double getDouble(int nIndex)
nIndex
- the first column is 1, the second is 2, ...
public java.lang.Object getObject(int nIndex)
nIndex
- the first column is 1, the second is 2, ...
public java.sql.ResultSet getResultSet()
public java.lang.Object getObject(java.lang.String strColumnName)
strColumnName
- column name
public boolean next()
public void setIntNull(int nIndex)
nIndex
- parameter indexprotected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
- An exceptionObject.finalize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |