- All Superinterfaces:
- PreparedStatement, Statement
- See Also:
- Top Examples, Source Code,
Connection.prepareCall(java.lang.String)
,
ResultSet
Array getArray(int i)
throws SQLException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[319]Call Oracle stored procedure
By Anonymous on 2004/06/17 08:15:40 Rate
// SQL92 syntax
CallableStatement cs1 = conn.prepareCall ( " { call proc ( ?,? ) } " ) ; // stored proc
CallableStatement cs2 = conn.prepareCall ( " { ? = call func ( ?,? ) } " ) ; // stored func
// Oracle PL/SQL block syntax
CallableStatement cs3 = conn.prepareCall ( "begin proc ( ?,? ) ; end;" ) ; // stored proc
CallableStatement cs4 = conn.prepareCall ( "begin ? := func ( ?,? ) ; end;" ) ; // stored func. getArray
Array getArray(String parameterName)
throws SQLException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
BigDecimal getBigDecimal(int parameterIndex)
throws SQLException
- See Also:
setBigDecimal(java.lang.String, java.math.BigDecimal)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
@Deprecated
BigDecimal getBigDecimal(int parameterIndex,
int scale)
throws SQLException
- See Also:
setBigDecimal(java.lang.String, java.math.BigDecimal)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
BigDecimal getBigDecimal(String parameterName)
throws SQLException
- See Also:
setBigDecimal(java.lang.String, java.math.BigDecimal)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
Blob getBlob(int i)
throws SQLException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
Blob getBlob(String parameterName)
throws SQLException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
boolean getBoolean(int parameterIndex)
throws SQLException
- See Also:
setBoolean(java.lang.String, boolean)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
boolean getBoolean(String parameterName)
throws SQLException
- See Also:
setBoolean(java.lang.String, boolean)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
byte getByte(int parameterIndex)
throws SQLException
- See Also:
setByte(java.lang.String, byte)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
byte getByte(String parameterName)
throws SQLException
- See Also:
setByte(java.lang.String, byte)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
byte[] getBytes(int parameterIndex)
throws SQLException
- See Also:
setBytes(java.lang.String, byte[])
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
byte[] getBytes(String parameterName)
throws SQLException
- See Also:
setBytes(java.lang.String, byte[])
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
Clob getClob(int i)
throws SQLException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
Clob getClob(String parameterName)
throws SQLException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
Date getDate(int parameterIndex)
throws SQLException
- See Also:
setDate(java.lang.String, java.sql.Date)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
Date getDate(int parameterIndex,
Calendar cal)
throws SQLException
- See Also:
setDate(java.lang.String, java.sql.Date)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
Date getDate(String parameterName)
throws SQLException
- See Also:
setDate(java.lang.String, java.sql.Date)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
Date getDate(String parameterName,
Calendar cal)
throws SQLException
- See Also:
setDate(java.lang.String, java.sql.Date)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
double getDouble(int parameterIndex)
throws SQLException
- See Also:
setDouble(java.lang.String, double)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
double getDouble(String parameterName)
throws SQLException
- See Also:
setDouble(java.lang.String, double)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
float getFloat(int parameterIndex)
throws SQLException
- See Also:
setFloat(java.lang.String, float)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
float getFloat(String parameterName)
throws SQLException
- See Also:
setFloat(java.lang.String, float)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
int getInt(int parameterIndex)
throws SQLException
- See Also:
setInt(java.lang.String, int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
int getInt(String parameterName)
throws SQLException
- See Also:
setInt(java.lang.String, int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
long getLong(int parameterIndex)
throws SQLException
- See Also:
setLong(java.lang.String, long)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
long getLong(String parameterName)
throws SQLException
- See Also:
setLong(java.lang.String, long)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
Object getObject(int parameterIndex)
throws SQLException
- See Also:
setObject(java.lang.String, java.lang.Object, int, int)
, Types
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
Object getObject(int i,
Map<String,Class<?>> map)
throws SQLException
- See Also:
setObject(java.lang.String, java.lang.Object, int, int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
Object getObject(String parameterName)
throws SQLException
- See Also:
setObject(java.lang.String, java.lang.Object, int, int)
, Types
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
Object getObject(String parameterName,
Map<String,Class<?>> map)
throws SQLException
- See Also:
setObject(java.lang.String, java.lang.Object, int, int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
Ref getRef(int i)
throws SQLException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
Ref getRef(String parameterName)
throws SQLException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
short getShort(int parameterIndex)
throws SQLException
- See Also:
setShort(java.lang.String, short)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
short getShort(String parameterName)
throws SQLException
- See Also:
setShort(java.lang.String, short)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
String getString(int parameterIndex)
throws SQLException
- See Also:
setString(java.lang.String, java.lang.String)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
String getString(String parameterName)
throws SQLException
- See Also:
setString(java.lang.String, java.lang.String)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
Time getTime(int parameterIndex)
throws SQLException
- See Also:
setTime(java.lang.String, java.sql.Time)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
Time getTime(int parameterIndex,
Calendar cal)
throws SQLException
- See Also:
setTime(java.lang.String, java.sql.Time)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
Time getTime(String parameterName)
throws SQLException
- See Also:
setTime(java.lang.String, java.sql.Time)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
Time getTime(String parameterName,
Calendar cal)
throws SQLException
- See Also:
setTime(java.lang.String, java.sql.Time)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
Timestamp getTimestamp(int parameterIndex)
throws SQLException
- See Also:
setTimestamp(java.lang.String, java.sql.Timestamp)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
Timestamp getTimestamp(int parameterIndex,
Calendar cal)
throws SQLException
- See Also:
setTimestamp(java.lang.String, java.sql.Timestamp)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
Timestamp getTimestamp(String parameterName)
throws SQLException
- See Also:
setTimestamp(java.lang.String, java.sql.Timestamp)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
Timestamp getTimestamp(String parameterName,
Calendar cal)
throws SQLException
- See Also:
setTimestamp(java.lang.String, java.sql.Timestamp)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
URL getURL(int parameterIndex)
throws SQLException
- See Also:
setURL(java.lang.String, java.net.URL)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
URL getURL(String parameterName)
throws SQLException
- See Also:
setURL(java.lang.String, java.net.URL)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void registerOutParameter(int parameterIndex,
int sqlType)
throws SQLException
- See Also:
Types
, getObject(int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[321]Change stored procedure in out parameters
By Anonymous on 2004/04/15 11:33:50 Rate
Connection conn = DriverManager.getConnection ( "jdbc:oracle:oci:@ < hoststring > ", "scott", "tiger" ) ;
CallableStatement cs = conn.prepareCall ( "begin ? := foo ( ? ) ; end;" ) ;
cs.registerOutParameter ( 1,Types.CHAR ) ;
cs.setString ( 2, "aa" ) ;
cs.executeUpdate ( ) ;
String result = cs.getString ( 1 ) ;
void registerOutParameter(int parameterIndex,
int sqlType,
int scale)
throws SQLException
- See Also:
Types
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[799]Return Oracle auto-generated primary key
By comazzi { at } sercomtel { dot } com { dot } br on 2004/06/08 09:36:29 Rate
// RETURN PRIMARY KEY
// WORKS ORACLE DATABASE
CallableStatement cstmt = null;
StringBuffer sql = new StringBuffer ( ) ;
sql.append ( "BEGIN INSERT INTO pe_papel ( pe_org_id,pe_pessoa_id," ) ;
sql.append ( "pe_papel_tipo_id,inicio ) VALUES ( ?,?,?,? ) RETURNING " ) ;
sql.append ( "pe_papel_id INTO ?; END;" ) ; // return auto-generated P.K.
cstmt = conn.prepareCall ( sql.toString ( ) ) ;
cstmt.registerOutParameter ( 5,Types.INTEGER ) ;
cstmt.setLong ( 1,pessoa.getOrgId ( ) ) ;
cstmt.setLong ( 2,pessoa.getId ( ) ) ;
cstmt.setLong ( 3,papelTipoId ) ;
cstmt.execute ( )
long primaryKey = cstmt.getLong ( 5 ) ;
void registerOutParameter(int paramIndex,
int sqlType,
String typeName)
throws SQLException
- See Also:
Types
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void registerOutParameter(String parameterName,
int sqlType)
throws SQLException
- See Also:
Types
, getObject(int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void registerOutParameter(String parameterName,
int sqlType,
int scale)
throws SQLException
- See Also:
Types
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void registerOutParameter(String parameterName,
int sqlType,
String typeName)
throws SQLException
- See Also:
Types
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void setAsciiStream(String parameterName,
InputStream x,
int length)
throws SQLException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void setBigDecimal(String parameterName,
BigDecimal x)
throws SQLException
- See Also:
getBigDecimal(int, int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void setBinaryStream(String parameterName,
InputStream x,
int length)
throws SQLException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void setBoolean(String parameterName,
boolean x)
throws SQLException
- See Also:
getBoolean(int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void setByte(String parameterName,
byte x)
throws SQLException
- See Also:
getByte(int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void setBytes(String parameterName,
byte[] x)
throws SQLException
- See Also:
getBytes(int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void setCharacterStream(String parameterName,
Reader reader,
int length)
throws SQLException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void setDate(String parameterName,
Date x)
throws SQLException
- See Also:
getDate(int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[485]Set Date parameter in a stored procedure
By Anonymous on 2005/01/06 07:43:41 Rate
stmt = this.connection.prepareCall ( " { call saveDate ( ? ) } " ) ;
stmt.setDate ( 1, calendar.getTime ( ) ) ;
stmt.setInt ( 2, 12 ) ;
[677]_
By Previous submission is wrong (thicko) on 2005/07/06 12:45:24 Rate
stmt = this.connection.prepareCall ( " { call saveDate ( ? ) } " ) ;
stmt.setDate ( 1, new java.sql.Date ( calendar.getTime ( ) .getTime ( ) ) ;
void setDate(String parameterName,
Date x,
Calendar cal)
throws SQLException
- See Also:
getDate(int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void setDouble(String parameterName,
double x)
throws SQLException
- See Also:
getDouble(int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void setFloat(String parameterName,
float x)
throws SQLException
- See Also:
getFloat(int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void setInt(String parameterName,
int x)
throws SQLException
- See Also:
getInt(int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void setLong(String parameterName,
long x)
throws SQLException
- See Also:
getLong(int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void setNull(String parameterName,
int sqlType)
throws SQLException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void setNull(String parameterName,
int sqlType,
String typeName)
throws SQLException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void setObject(String parameterName,
Object x)
throws SQLException
- See Also:
getObject(int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void setObject(String parameterName,
Object x,
int targetSqlType)
throws SQLException
- See Also:
getObject(int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[167]_
By Anonymous on 2004/05/05 08:55:29 Rate
cstmt.setObject ( 10, xmldoc ) ;
void setObject(String parameterName,
Object x,
int targetSqlType,
int scale)
throws SQLException
- See Also:
getObject(int)
, Types
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void setShort(String parameterName,
short x)
throws SQLException
- See Also:
getShort(int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void setString(String parameterName,
String x)
throws SQLException
- See Also:
getString(int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void setTime(String parameterName,
Time x)
throws SQLException
- See Also:
getTime(int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void setTime(String parameterName,
Time x,
Calendar cal)
throws SQLException
- See Also:
getTime(int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void setTimestamp(String parameterName,
Timestamp x)
throws SQLException
- See Also:
getTimestamp(int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void setTimestamp(String parameterName,
Timestamp x,
Calendar cal)
throws SQLException
- See Also:
getTimestamp(int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void setURL(String parameterName,
URL val)
throws SQLException
- See Also:
getURL(int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
boolean wasNull()
throws SQLException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples