本文整理匯總了Java中java.sql.ResultSet.isLast方法的典型用法代碼示例。如果您正苦於以下問題:Java ResultSet.isLast方法的具體用法?Java ResultSet.isLast怎麽用?Java ResultSet.isLast使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.sql.ResultSet
的用法示例。
在下文中一共展示了ResultSet.isLast方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: processRecord
import java.sql.ResultSet; //導入方法依賴的package包/類
@Override
protected void processRecord(final StringBuilder result, final ResultSet resultSet) throws SQLException {
final String javaDoc = resultSet.getString(1);
final String javaNameBase = resultSet.getString(2);
final String javaStatement = resultSet.getString(3);
// Javadoc
result.append(INDENTATION).append("/** ").append(javaDoc).append(" */\n");
// Statement
result.append(INDENTATION).append(Utils.convertToJavaEnumName(javaNameBase)).append(javaStatement);
// Seperator
if (resultSet.isLast()) {
result.append(";\n");
} else {
result.append(",\n");
}
}
示例2: getTPS_statement
import java.sql.ResultSet; //導入方法依賴的package包/類
/**
* Computes the current TPM count by issuing a SQL statement to the database.
* @throws SQLException
*/
private void getTPS_statement() throws SQLException{
//PostGreSQL
ResultSet rs = executeSQLStmt("select xact_commit from pg_stat_database");
while (rs.next()) {
int currentTPS = rs.getInt(1);
if(rs.isLast()){
currentTPS = rs.getInt(1);
this.TPM = (currentTPS - previous_TPS);
previous_TPS = currentTPS;
}
}
}
示例3: SignalGraph
import java.sql.ResultSet; //導入方法依賴的package包/類
/**
* Gets all signal measurements from a test
*
* @param testUID the test uid
* @param testTime the begin of the test
* @throws SQLException
*/
public SignalGraph(long testUID, UUID openTestUuid, long testTime, java.sql.Connection conn) throws SQLException {
PreparedStatement psSignal = conn.prepareStatement("SELECT test_id, nt.name network_type, nt.group_name cat_technology, signal_strength, lte_rsrp, lte_rsrq, wifi_rssi, time "
+ "FROM signal "
+ "JOIN network_type nt "
+ "ON nt.uid = network_type_id "
+ "WHERE test_id = ? "
+ "ORDER BY time;");
psSignal.setLong(1, testUID);
ResultSet rsSignal = psSignal.executeQuery();
//if there are no results -> try using the new radio-tables that may be available for some measurements
if (!rsSignal.isBeforeFirst()) {
psSignal = conn.prepareStatement("SELECT radio_cell.open_test_uuid, nt.name network_type, technology cat_technology, signal_strength, lte_rsrp, lte_rsrq, signal_strength wifi_rssi, time " +
"FROM radio_cell " +
"JOIN radio_signal ON radio_signal.cell_uuid = radio_cell.uuid " +
"JOIN network_type nt ON nt.uid = network_type_id " +
"WHERE radio_cell.open_test_uuid = ? " +
"AND radio_cell.active = TRUE " +
" ORDER BY radio_signal.time;");
psSignal.setObject(1, openTestUuid);
rsSignal = psSignal.executeQuery();
}
boolean first = true;
SignalGraphItem item = null;
while (rsSignal.next()) {
long timeElapsed = rsSignal.getTimestamp("time").getTime() - testTime;
//there could be measurements taken before a test started
//in this case, only return the last one
if (first && timeElapsed > 0 && item != null) {
this.signalList.add(item);
first = false;
}
//ignore measurements after a threshold of one minute
if (timeElapsed > MAX_TIME)
break;
int signalStrength = rsSignal.getInt("signal_strength");
int lteRsrp = rsSignal.getInt("lte_rsrp");
int lteRsrq = rsSignal.getInt("lte_rsrq");
if (signalStrength == 0)
signalStrength = rsSignal.getInt("wifi_rssi");
if (signalStrength > LOWER_BOUND)
item = new SignalGraphItem(Math.max(timeElapsed, 0), rsSignal.getString("network_type"), signalStrength, lteRsrp, lteRsrq, rsSignal.getString("cat_technology"));
//put 5-let in the array if it is not the first one
if (!first || rsSignal.isLast()) {
if (timeElapsed < 0) {
item.timeElapsed = 1000;
}
this.signalList.add(item);
}
}
rsSignal.close();
psSignal.close();
}
示例4: SignalGraph
import java.sql.ResultSet; //導入方法依賴的package包/類
/**
* Gets all signal measurements from a test
* @param testUID the test uid
* @param testTime the begin of the test
* @throws SQLException
*/
public SignalGraph(long testUID, long testTime, java.sql.Connection conn) throws SQLException {
PreparedStatement psSignal = conn.prepareStatement("SELECT test_id, nt.name network_type, nt.group_name cat_technology, signal_strength, lte_rsrp, lte_rsrq, wifi_rssi, time "
+ "FROM signal "
+ "JOIN network_type nt "
+ "ON nt.uid = network_type_id "
+ "WHERE test_id = ? "
+ "ORDER BY time;");
psSignal.setLong(1, testUID);
ResultSet rsSignal = psSignal.executeQuery();
boolean first = true;
SignalGraphItem item = null;
while (rsSignal.next()) {
long timeElapsed = rsSignal.getTimestamp("time").getTime() - testTime;
//there could be measurements taken before a test started
//in this case, only return the last one
if (first && timeElapsed > 0 && item != null) {
this.signalList.add(item);
first = false;
}
//ignore measurements after a threshold of one minute
if (timeElapsed > MAX_TIME)
break;
int signalStrength = rsSignal.getInt("signal_strength");
int lteRsrp = rsSignal.getInt("lte_rsrp");
int lteRsrq = rsSignal.getInt("lte_rsrq");
if (signalStrength == 0)
signalStrength = rsSignal.getInt("wifi_rssi");
if (signalStrength > LOWER_BOUND)
item = new SignalGraphItem(Math.max(timeElapsed,0), rsSignal.getString("network_type"), signalStrength, lteRsrp, lteRsrq, rsSignal.getString("cat_technology"));
//put 5-let in the array if it is not the first one
if (!first || rsSignal.isLast()) {
if (timeElapsed < 0) {
item.timeElapsed = 1000;
}
this.signalList.add(item);
}
}
rsSignal.close();
psSignal.close();
}
示例5: SignalGraph
import java.sql.ResultSet; //導入方法依賴的package包/類
/**
* Gets all signal measurements from a test
* @param testUID the test uid
* @param testTime the begin of the test
* @throws SQLException
*/
public SignalGraph(long testUID, UUID openTestUuid, long testTime, java.sql.Connection conn) throws SQLException {
PreparedStatement psSignal = conn.prepareStatement("SELECT test_id, nt.name network_type, nt.group_name cat_technology, signal_strength, lte_rsrp, lte_rsrq, wifi_rssi, time "
+ "FROM signal "
+ "JOIN network_type nt "
+ "ON nt.uid = network_type_id "
+ "WHERE test_id = ? "
+ "ORDER BY time;");
psSignal.setLong(1, testUID);
ResultSet rsSignal = psSignal.executeQuery();
//if there are no results -> try using the new radio-tables that may be available for some measurements
if (!rsSignal.isBeforeFirst()) {
psSignal = conn.prepareStatement("SELECT radio_cell.open_test_uuid, nt.name network_type, technology cat_technology, signal_strength, lte_rsrp, lte_rsrq, signal_strength wifi_rssi, time " +
"FROM radio_cell " +
"JOIN radio_signal ON radio_signal.cell_uuid = radio_cell.uuid " +
"JOIN network_type nt ON nt.uid = network_type_id " +
"WHERE radio_cell.open_test_uuid = ? " +
"AND radio_cell.active = TRUE " +
" ORDER BY radio_signal.time;");
psSignal.setObject(1, openTestUuid);
rsSignal = psSignal.executeQuery();
}
boolean first = true;
SignalGraphItem item = null;
while (rsSignal.next()) {
long timeElapsed = rsSignal.getTimestamp("time").getTime() - testTime;
//there could be measurements taken before a test started
//in this case, only return the last one
if (first && timeElapsed > 0 && item != null) {
this.signalList.add(item);
first = false;
}
//ignore measurements after a threshold of one minute
if (timeElapsed > MAX_TIME)
break;
int signalStrength = rsSignal.getInt("signal_strength");
int lteRsrp = rsSignal.getInt("lte_rsrp");
int lteRsrq = rsSignal.getInt("lte_rsrq");
if (signalStrength == 0)
signalStrength = rsSignal.getInt("wifi_rssi");
if (signalStrength > LOWER_BOUND)
item = new SignalGraphItem(Math.max(timeElapsed,0), rsSignal.getString("network_type"), signalStrength, lteRsrp, lteRsrq, rsSignal.getString("cat_technology"));
//put 5-let in the array if it is not the first one
if (!first || rsSignal.isLast()) {
if (timeElapsed < 0) {
item.timeElapsed = 1000;
}
this.signalList.add(item);
}
}
rsSignal.close();
psSignal.close();
}