當前位置: 首頁>>代碼示例>>Java>>正文


Java ResultSet.getRowId方法代碼示例

本文整理匯總了Java中java.sql.ResultSet.getRowId方法的典型用法代碼示例。如果您正苦於以下問題:Java ResultSet.getRowId方法的具體用法?Java ResultSet.getRowId怎麽用?Java ResultSet.getRowId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.sql.ResultSet的用法示例。


在下文中一共展示了ResultSet.getRowId方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: formatRowIdColumn

import java.sql.ResultSet; //導入方法依賴的package包/類
/**
    * Format the column as a RowId
    * 
    * @param resultSet
    * @param columnIndex
    * @return
    * @throws SQLException
    * @throws IOException
    */
   private String formatRowIdColumn(ResultSet resultSet, int columnIndex)
    throws SQLException, IOException {
RowId rowId = resultSet.getRowId(columnIndex);

String sessionId = request.getParameter(HttpParameter.SESSION_ID);

if (!ConnectionStore.isStateless(username, sessionId)) {
    ConnectionStore connectionStore = new ConnectionStore(username,
	    sessionId);
    Connection connection = connectionStore.get();

    if (connection == null) {
	throw new SQLException(SqlReturnCode.SESSION_INVALIDATED);
    }

    connectionStore.put(rowId);
}

return rowId.toString();
// RowIdHttp rowIdHttp = new RowIdHttp(rowId.hashCode(),
// rowId.getBytes());
//
// RowIdTransporter rowIdTransporter = new RowIdTransporter();
// String base64 = rowIdTransporter.toBase64(rowIdHttp);
// return base64;
   }
 
開發者ID:kawansoft,項目名稱:aceql-http,代碼行數:36,代碼來源:ResultSetWriter.java

示例2: createSubEvents

import java.sql.ResultSet; //導入方法依賴的package包/類
private RowId createSubEvents(final String query, RowId rid, String tableName, boolean isChildQuery) throws SyncError {
	logger.info("createSubEvents called with parameters : isChildQuery =" + isChildQuery + " , rid = " + rid
			+ " , tableName = " + tableName + " , query = " + query);
	PreparedStatement rowIdpstmt = null;
	ResultSet rowIdSet = null;
	RowId maxRid = null;
	RowId minRid = null;
	try {
		rowIdpstmt = connection.prepareStatement(query, ResultSet.TYPE_SCROLL_INSENSITIVE,
				ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);
		if (isChildQuery) {
			rowIdpstmt.setRowId(1, rid);
		}
		rowIdpstmt.setFetchSize(5000);
		rowIdSet = rowIdpstmt.executeQuery();
		rowIdSet.next();
		minRid = rowIdSet.getRowId(1);
		for (++subEventCount; subEventCount < (degree - 1); subEventCount++) {
			rowIdSet.relative((int) optimalRange);
			maxRid = rowIdSet.getRowId(1);
			getSubEvent(minRid, maxRid, false);
			minRid = maxRid;
			fetchCount += optimalRange;
			if (fetchCount > 1000000L) {
				break;
			}
		}
		if (subEventCount == (degree - 1)) {
			rowIdSet.last();
			maxRid = rowIdSet.getRowId(1);
			getSubEvent(minRid, maxRid, true);
			logger.info("Total subEvents created :" + eventCount);
		}
	} catch (Exception e) {
		logger.error("Error while creating subEvents ", e);
		throw new SyncError(e);
	} finally {
		DbResourceUtils.closeResources(rowIdSet, rowIdpstmt, null);
	}
	return maxRid;
}
 
開發者ID:gagoyal01,項目名稱:mongodb-rdbms-sync,代碼行數:42,代碼來源:O2MEventDistributorNew.java

示例3: createSubEvents

import java.sql.ResultSet; //導入方法依賴的package包/類
private RowId createSubEvents(String query, RowId rid, String tableName, boolean isChildQuery) throws SyncError{
	logger.info("createSubEvents called with parameters : isChildQuery =" + isChildQuery + " , rid = " + rid
			+ " , tableName = " + tableName + " , query = " + query);
	PreparedStatement rowIdpstmt = null;
	ResultSet rowIdSet = null;
	RowId maxRid = null;
	RowId minRid = null;
	try {
		rowIdpstmt = connection.prepareStatement(query, ResultSet.TYPE_SCROLL_INSENSITIVE,
				ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);
		if (isChildQuery) {
			rowIdpstmt.setRowId(1, rid);
		}
		rowIdpstmt.setFetchSize(5000);
		rowIdSet = rowIdpstmt.executeQuery();
		rowIdSet.next();
		minRid = rowIdSet.getRowId(1);
		for (++subEventCount;subEventCount < (degree - 1); subEventCount++) {
			rowIdSet.relative((int) optimalRange);
			maxRid = rowIdSet.getRowId(1);
			getSubEvent(minRid, maxRid, false);
			minRid = maxRid;
			fetchCount += optimalRange;
			if (fetchCount > 1000000L) {
				break;
			}
		}
		if (subEventCount == (degree - 1)) {
			rowIdSet.last();
			maxRid = rowIdSet.getRowId(1);
			getSubEvent(minRid, maxRid, true);
			logger.info("Total subEvents created :" + eventCount);
		}
	} catch (Exception e) {
		logger.error("Error while creating subEvents ", e);
		throw new SyncError(e);
	} finally {
		DbResourceUtils.closeResources(rowIdSet, rowIdpstmt, null);
	}
	return maxRid;
}
 
開發者ID:gagoyal01,項目名稱:mongodb-rdbms-sync,代碼行數:42,代碼來源:O2MEventDistributor.java


注:本文中的java.sql.ResultSet.getRowId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。