当前位置: 首页>>代码示例>>Java>>正文


Java CallableStatement.getString方法代码示例

本文整理汇总了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) {
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:OracleTableMetaDataProvider.java

示例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();
    }
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:27,代码来源:BlobRoomAvailabilityService.java

示例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();
	} 
	
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:28,代码来源:ImportXmlFromDB.java

示例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;
	}
}
 
开发者ID:xsonorg,项目名称:tangyuan2,代码行数:10,代码来源:CharacterTypeHandler.java

示例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;
            }
        }
 
开发者ID:uavorg,项目名称:uavstack,代码行数:11,代码来源:DAOFactory.java

示例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;
}
 
开发者ID:jaffa-projects,项目名称:jaffa-framework,代码行数:21,代码来源:TypeDefs.java

示例7: getNullableResult

import java.sql.CallableStatement; //导入方法依赖的package包/类
@Override
public PhoneNumber getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
    return new PhoneNumber(cs.getString(columnIndex));
}
 
开发者ID:Caratacus,项目名称:mybatis-plus-mini,代码行数:5,代码来源:PhoneTypeHandler.java

示例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);
}
 
开发者ID:mybatis,项目名称:typehandlers-threeten-extra,代码行数:6,代码来源:YearQuarterTypeHandler.java

示例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);
}
 
开发者ID:mybatis,项目名称:typehandlers-threeten-extra,代码行数:6,代码来源:YearWeekTypeHandler.java

示例10: getNullableResult

import java.sql.CallableStatement; //导入方法依赖的package包/类
@Override
public String getNullableResult(CallableStatement cs, int columnIndex)
        throws SQLException {
    return cs.getString(columnIndex);
}
 
开发者ID:Yanweichen,项目名称:MybatisGeneatorUtil,代码行数:6,代码来源:StringType2Handler.java

示例11: getNullableResult

import java.sql.CallableStatement; //导入方法依赖的package包/类
@Override
public String getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
	return cs.getString(columnIndex);
}
 
开发者ID:xsonorg,项目名称:tangyuan2,代码行数:5,代码来源:NStringTypeHandler.java

示例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);
}
 
开发者ID:xsonorg,项目名称:tangyuan2,代码行数:6,代码来源:EnumTypeHandler.java

示例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);
}
 
开发者ID:cvent,项目名称:dropwizard-mybatis,代码行数:6,代码来源:AbstractTypeHandler.java

示例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);
}
 
开发者ID:Ulyssesss,项目名称:java-demo,代码行数:6,代码来源:MyStringTypeHandler.java

示例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);
}
 
开发者ID:drtrang,项目名称:typehandlers-encrypt,代码行数:7,代码来源:EncryptTypeHandler.java


注:本文中的java.sql.CallableStatement.getString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。