📄 callablestatement_base.java
字号:
*/
public java.sql.Time getTime(int parameterIndex) throws SQLException
{
throw new SQLException("Not implemented");
}
/**
* Get the value of a SQL TIMESTAMP parameter as a java.sql.Timestamp object.
*
* @param parameterIndex the first parameter is 1, the second is 2, ...
* @return the parameter value; if the value is SQL NULL, the result is null
* @exception SQLException if a database-access error occurs.
*/
public java.sql.Timestamp getTimestamp(int parameterIndex)
throws SQLException
{
throw new SQLException("Not implemented");
}
/**
* Before executing a stored procedure call, you must explicitly
* call registerOutParameter to register the java.sql.Type of each
* out parameter.
*
* <P><B>Note:</B> When reading the value of an out parameter, you
* must use the getXXX method whose Java type XXX corresponds to the
* parameter's registered SQL type.
*
* @param parameterIndex the first parameter is 1, the second is 2,...
* @param sqlType SQL type code defined by java.sql.Types;
* for parameters of type Numeric or Decimal use the version of
* registerOutParameter that accepts a scale value
* @exception SQLException if a database-access error occurs.
* @see Type
*/
public void registerOutParameter(int parameterIndex, int sqlType)
throws SQLException
{
throw new SQLException("Not implemented");
}
/**
* Use this version of registerOutParameter for registering
* Numeric or Decimal out parameters.
*
* <P><B>Note:</B> When reading the value of an out parameter, you
* must use the getXXX method whose Java type XXX corresponds to the
* parameter's registered SQL type.
*
* @param parameterIndex the first parameter is 1, the second is 2, ...
* @param sqlType use either java.sql.Type.NUMERIC or java.sql.Type.DECIMAL
* @param scale a value greater than or equal to zero representing the
* desired number of digits to the right of the decimal point
* @exception SQLException if a database-access error occurs.
* @see Type
*/
public void registerOutParameter(int parameterIndex, int sqlType, int scale)
throws SQLException
{
throw new SQLException("Not implemented");
}
/**
* An OUT parameter may have the value of SQL NULL; wasNull reports
* whether the last value read has this special value.
*
* <P><B>Note:</B> You must first call getXXX on a parameter to
* read its value and then call wasNull() to see if the value was
* SQL NULL.
*
* @return true if the last parameter read was SQL NULL
* @exception SQLException if a database-access error occurs.
*/
public boolean wasNull() throws SQLException
{
throw new SQLException("Not implemented");
}
public boolean execute()
throws SQLException
{
boolean result;
closeResults();
updateCount = -2;
// First make sure the caller has filled in all the parameters.
ParameterUtils.verifyThatParametersAreSet(parameterList);
// execute the stored procedure
result = executeCall(procedureName,
parameterList,
parameterList);
return result;
}
//--------------------------JDBC 2.0-----------------------------
/**
* JDBC 2.0
*
* Gets the value of a JDBC <code>NUMERIC</code> parameter as a
* <code>java.math.BigDecimal</code> object with as many digits to the
* right of the decimal point as the value contains.
* @param parameterIndex the first parameter is 1, the second is 2,
* and so on
* @return the parameter value in full precision. If the value is
* SQL NULL, the result is <code>null</code>.
* @exception SQLException if a database access error occurs
*/
public BigDecimal getBigDecimal(int parameterIndex) throws SQLException
{
NotImplemented();
return null;
}
/**
* Gets the value of a JDBC <code>DATE</code> parameter as a
* <code>java.sql.Date</code> object, using
* the given <code>Calendar</code> object
* to construct the date.
* With a <code>Calendar</code> object, the driver
* can calculate the date taking into account a custom timezone and locale.
* If no <code>Calendar</code> object is specified, the driver uses the
* default timezone and locale.
*
* @param parameterIndex the first parameter is 1, the second is 2,
* and so on
* @param cal the <code>Calendar</code> object the driver will use
* to construct the date
* @return the parameter value. If the value is SQL NULL, the result is
* <code>null</code>.
* @exception SQLException if a database access error occurs
*/
public java.sql.Date getDate(int parameterIndex, Calendar cal)
throws SQLException
{
NotImplemented();
return null;
}
/**
* Gets the value of a JDBC <code>TIME</code> parameter as a
* <code>java.sql.Time</code> object, using
* the given <code>Calendar</code> object
* to construct the time.
* With a <code>Calendar</code> object, the driver
* can calculate the time taking into account a custom timezone and locale.
* If no <code>Calendar</code> object is specified, the driver uses the
* default timezone and locale.
*
* @param parameterIndex the first parameter is 1, the second is 2,
* and so on
* @param cal the <code>Calendar</code> object the driver will use
* to construct the time
* @return the parameter value; if the value is SQL NULL, the result is
* <code>null</code>.
* @exception SQLException if a database access error occurs
*/
public java.sql.Time getTime(int parameterIndex, Calendar cal)
throws SQLException
{
NotImplemented();
return null;
}
/**
* Gets the value of a JDBC <code>TIMESTAMP</code> parameter as a
* <code>java.sql.Timestamp</code> object, using
* the given <code>Calendar</code> object to construct
* the <code>Timestamp</code> object.
* With a <code>Calendar</code> object, the driver
* can calculate the timestamp taking into account a custom timezone and locale.
* If no <code>Calendar</code> object is specified, the driver uses the
* default timezone and locale.
*
*
* @param parameterIndex the first parameter is 1, the second is 2,
* and so on
* @param cal the <code>Calendar</code> object the driver will use
* to construct the timestamp
* @return the parameter value. If the value is SQL NULL, the result is
* <code>null</code>.
* @exception SQLException if a database access error occurs
*/
public java.sql.Timestamp getTimestamp(int parameterIndex, Calendar cal)
throws SQLException
{
NotImplemented();
return null;
}
/**
* JDBC 2.0
*
* Registers the designated output parameter. This version of
* the method <code>registerOutParameter</code>
* should be used for a user-named or REF output parameter. Examples
* of user-named types include: STRUCT, DISTINCT, JAVA_OBJECT, and
* named array types.
*
* Before executing a stored procedure call, you must explicitly
* call <code>registerOutParameter</code> to register the type from
* <code>java.sql.Types</code> for each
* OUT parameter. For a user-named parameter the fully-qualified SQL
* type name of the parameter should also be given, while a REF
* parameter requires that the fully-qualified type name of the
* referenced type be given. A JDBC driver that does not need the
* type code and type name information may ignore it. To be portable,
* however, applications should always provide these values for
* user-named and REF parameters.
*
* Although it is intended for user-named and REF parameters,
* this method may be used to register a parameter of any JDBC type.
* If the parameter does not have a user-named or REF type, the
* typeName parameter is ignored.
*
* <P><B>Note:</B> When reading the value of an out parameter, you
* must use the <code>getXXX</code> method whose Java type XXX corresponds to the
* parameter's registered SQL type.
*
* @param parameterIndex the first parameter is 1, the second is 2,...
* @param sqlType a value from {@link java.sql.Types}
* @param typeName the fully-qualified name of an SQL structured type
* @exception SQLException if a database-access error occurs
* @see Types
*/
public void registerOutParameter (int paramIndex, int sqlType, String typeName)
throws SQLException
{
NotImplemented();
}
static public void main(String args[])
throws java.lang.ClassNotFoundException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
{
try
{
String url = url = ""
+ "jdbc:freetds:"
+ "//"
+ "kap"
+ "/"
+ "pubs";
Class.forName("com.internetcds.jdbc.tds.Driver").newInstance();
java.sql.Connection connection;
connection = DriverManager.getConnection(url,
"testuser",
"password");
java.sql.CallableStatement call = connection.prepareCall(
"sp_tables ?");
call.setString(1, "%");
java.sql.ResultSet rs = call.executeQuery();
while(rs.next())
{
String qualifier = rs.getString("TABLE_QUALIFIER");
String owner = rs.getString("TABLE_OWNER");
String name = rs.getString("TABLE_NAME");
String type = rs.getString("TABLE_TYPE");
String remarks = rs.getString("REMARKS");
System.out.println("qualifier: " + qualifier);
System.out.println("owner: " + owner);
System.out.println("name: " + name);
System.out.println("type: " + type);
System.out.println("remarks: " + remarks);
System.out.println("");
}
}
catch(SQLException e)
{
e.printStackTrace();
System.out.println(e.getMessage());
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -