本文整理汇总了Java中java.sql.CallableStatement.getString方法的典型用法代码示例。如果您正苦于以下问题:Java CallableStatement.getString方法的具体用法?Java CallableStatement.getString怎么用?Java CallableStatement.getString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.sql.CallableStatement
的用法示例。
在下文中一共展示了CallableStatement.getString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: lookupDefaultSchema
import java.sql.CallableStatement; //导入方法依赖的package包/类
private void lookupDefaultSchema(DatabaseMetaData databaseMetaData) {
try {
CallableStatement cstmt = null;
try {
cstmt = databaseMetaData.getConnection().prepareCall("{? = call sys_context('USERENV', 'CURRENT_SCHEMA')}");
cstmt.registerOutParameter(1, Types.VARCHAR);
cstmt.execute();
this.defaultSchema = cstmt.getString(1);
}
finally {
if (cstmt != null) {
cstmt.close();
}
}
}
catch (Exception ignore) {
}
}
示例2: receiveResponse
import java.sql.CallableStatement; //导入方法依赖的package包/类
protected Document receiveResponse() throws IOException, DocumentException {
try {
SessionImplementor session = (SessionImplementor)new _RootDAO().getSession();
Connection connection = session.getJdbcConnectionAccess().obtainConnection();
String response = null;
try {
CallableStatement call = connection.prepareCall(iResponseSql);
call.registerOutParameter(1, java.sql.Types.CLOB);
call.execute();
response = call.getString(1);
call.close();
} finally {
session.getJdbcConnectionAccess().releaseConnection(connection);
}
if (response==null || response.length()==0) return null;
StringReader reader = new StringReader(response);
Document document = (new SAXReader()).read(reader);
reader.close();
return document;
} catch (Exception e) {
sLog.error("Unable to receive response: "+e.getMessage(),e);
return null;
} finally {
_RootDAO.closeCurrentThreadSessions();
}
}
示例3: importXml
import java.sql.CallableStatement; //导入方法依赖的package包/类
public static void importXml(String baseFileName){
Debug.info("filename = " + baseFileName);
try {
String fileReceiveSql =
ApplicationProperties.getProperty("tmtbl.data.exchange.receive.file","{?= call timetable.receive_xml_file.receive_file(?, ?)}");
String exchangeDir =
ApplicationProperties.getProperty("tmtbl.data.exchange.directory", "LOAD_SMASDEV");
SessionImplementor session = (SessionImplementor)new _RootDAO().getSession();
Connection connection = session.getJdbcConnectionAccess().obtainConnection();
CallableStatement call = connection.prepareCall(fileReceiveSql);
call.registerOutParameter(1, java.sql.Types.CLOB);
call.setString(2, exchangeDir);
call.setString(3, baseFileName);
call.execute();
String response = call.getString(1);
call.close();
session.getJdbcConnectionAccess().releaseConnection(connection);
if (response==null || response.length()==0) return;
StringReader reader = new StringReader(response);
Document document = (new SAXReader()).read(reader);
reader.close();
DataExchangeHelper.importDocument(document, null, null);
} catch (Exception e) {
e.printStackTrace();
}
}
示例4: getNullableResult
import java.sql.CallableStatement; //导入方法依赖的package包/类
@Override
public Character getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
String columnValue = cs.getString(columnIndex);
if (columnValue != null) {
return columnValue.charAt(0);
} else {
return null;
}
}
示例5: getResult
import java.sql.CallableStatement; //导入方法依赖的package包/类
public Object getResult(CallableStatement cs, int columnIndex) throws SQLException {
Object s = cs.getString(columnIndex);
if (cs.wasNull()) {
return null;
}
else {
return s;
}
}
示例6: getAppObject
import java.sql.CallableStatement; //导入方法依赖的package包/类
/** Gets a parameter from the CallableStatement.
* @return the parameter.
* @param engineType The engine type as defined in init.xml
* @param cstmt The CallableStatement.
* @param parameterIndex The index of the parameter.
* @throws SQLException if a database access error occurs.
* @throws IOException if any error occurs in reading the data from the database.
*/
public Object getAppObject(CallableStatement cstmt, int parameterIndex, String engineType) throws SQLException, IOException {
String str = cstmt.getString(parameterIndex);
if (str != null) {
//Trim the String by default. Do not trim if the rule is set to true!
Boolean doNotTrim = Parser.parseBoolean((String) ContextManagerFactory.instance().getProperty(DO_NOT_TRIM_RULE_NAME));
if (doNotTrim == null || !doNotTrim.booleanValue())
str = str.trim();
if (str.length() == 0)
str = null;
}
return str;
}
示例7: getNullableResult
import java.sql.CallableStatement; //导入方法依赖的package包/类
@Override
public PhoneNumber getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
return new PhoneNumber(cs.getString(columnIndex));
}
示例8: getNullableResult
import java.sql.CallableStatement; //导入方法依赖的package包/类
@Override
public YearQuarter getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
String str = cs.getString(columnIndex);
return getYearQuarter(str);
}
示例9: getNullableResult
import java.sql.CallableStatement; //导入方法依赖的package包/类
@Override
public YearWeek getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
String str = cs.getString(columnIndex);
return getYearWeek(str);
}
示例10: getNullableResult
import java.sql.CallableStatement; //导入方法依赖的package包/类
@Override
public String getNullableResult(CallableStatement cs, int columnIndex)
throws SQLException {
return cs.getString(columnIndex);
}
示例11: getNullableResult
import java.sql.CallableStatement; //导入方法依赖的package包/类
@Override
public String getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
return cs.getString(columnIndex);
}
示例12: getNullableResult
import java.sql.CallableStatement; //导入方法依赖的package包/类
@Override
public E getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
String s = cs.getString(columnIndex);
return s == null ? null : Enum.valueOf(type, s);
}
示例13: getNullableResult
import java.sql.CallableStatement; //导入方法依赖的package包/类
@Override
public T getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
String value = cs.getString(columnIndex);
return format(value);
}
示例14: getNullableResult
import java.sql.CallableStatement; //导入方法依赖的package包/类
@Override
public String getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
System.out.println("use MyStingTypeHandler getNullableResult callableStatement");
return cs.getString(columnIndex);
}
示例15: getNullableResult
import java.sql.CallableStatement; //导入方法依赖的package包/类
@Override
public String getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
String r = cs.getString(columnIndex);
// 兼容待修复的数据
return r == null ? null : (EncryptUtil.isEncrypted(r) ? EncryptUtil.decrypt(r) : r);
}