本文整理汇总了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();
}