Questions tagged [resultset]

A result set is a set of rows from a database, which is usually generated by executing a statement that queries the database. A resultSet object maintains a cursor pointing to its current row of data.

A result set is a set of rows from a database, which is usually generated by executing a statement that queries the database. A resultSet object maintains a cursor pointing to its current row of data.

2543 questions
0
votes
2 answers

How to fail the testng script if while(resultset.next()) returns false?

Sometimes, dbResultSetSalary.next() doesn't return any value for my query, which is false. In that case, how to fail the testng script? Below is my code :- import java.sql.ResultSet; import org.testng.annotations.Test; public class Test21 { …
avidCoder
  • 440
  • 2
  • 10
  • 28
0
votes
2 answers

Can ResultSetMetaData.getColumnLabel return null?

My question is can, ResultSetMetaData.getColumnLabel(int) return null ? Is there any known cases where any of the driver implementation return null ? If so, how to achieve that case. From documentation, it seems there is no such restriction. I want…
suraj1291993
  • 474
  • 1
  • 5
  • 15
0
votes
2 answers

Using BETWEEN SYMMETRIC for checking 2 row value expressions

I would like to compare two columns values from Table-1 (say colA, colX) to check if these are in the range of values for columns in Table-2 (say colB, colD, colY, colZ). That's, if colA is between colB-colD, and/or colX is between colY-colZ…
arilwan
  • 3,374
  • 5
  • 26
  • 62
0
votes
1 answer

Doing JOIN between H2 table and ResultSet (select from MySQL table)

I have to database, a MySQL database and a H2 database embedded in my Java application. I want to CREATE TABLE on H2 database joining a H2 table and a ResultSet, that is a SELECT from MySQL database. I want to perform this query on H2…
jumpy
  • 73
  • 7
0
votes
1 answer

mysqli_fetch_array() not producing an array

I can't seem to be able to place the resultset into an array and then use print_r to print out the array. Here's the script:
DCR
  • 14,737
  • 12
  • 52
  • 115
0
votes
1 answer

Get RowCount from a ResultSet after a few next() calls

I have the following code: //rs is a ResultSet from a prepared statement rs.last(); this.resultCount = rs.getRow(); rs.beforeFirst(); If I execute that code after i executed a few rs.next(), then the rs.beforeFirst() is wrong. So my question is:…
Robin Kreuzer
  • 162
  • 1
  • 10
0
votes
1 answer

How to store excel data in resultset using java

I need to compare excel data (rowwise) with database table. Can someone please help me on that. I can read excel file rowwise and column wise properly with below code public class POC { public static void main(String[] args) { String colText =…
Dolly
  • 97
  • 3
  • 18
0
votes
1 answer

Why does the last "ResultSet.next()"-iteration take way more time than the previous iterations?

The last iteration of my "while(res.next())"-loop takes 1.5 seconds whereas the previous iterations only take around ~0,003 milliseconds. I'm very confused. I'm getting a ResultSet from my SQLite database with a common JDBC query. The ResultSet is…
Michzor
  • 11
  • 3
0
votes
1 answer

is there single method for updating a resultset entry?

I can see so many update methods in for resultset based on the datatypes of the fields. Isnt there any single method for it? Or can anyone suggest an alternative?
Piyush Lohana
  • 43
  • 2
  • 7
0
votes
3 answers

can't print from ResultSet transferred to Client From Server

i need to create a client-server connection (in JAVA), where the server is connected to a database and the client can send queries and get answers. I use the OCSF (by Dr. Timothy C. Lethbridge) , and JDBC driver for JAVA. at the server's side, i…
Daniel Briskman
  • 399
  • 2
  • 3
  • 11
0
votes
1 answer

cannot read property of undefined with result of mysql

I have this problem, although I managed the value of "result", the conditional expression "if" evaluates "result" always as "! == undefined" I also tried to manage with "result! == ''" but not handles it correctly. In this case I have no results…
user11751709
0
votes
1 answer

SelectResults query in Unit Tests

I need to assign values to SelectResults and use this for JUnit purposes. I could assign StructImpl values but could not do it for SelectResults. String[] FieldNames; Object[] FieldValues; StructImpl s1; List structImplList = new…
user1479469
  • 45
  • 3
  • 9
0
votes
1 answer

Is it possible to query all records in Cassandra based on a condition?

I have a table with contains a list of user records. I need to query all records based on some condition. The use case is I have about 30 million records in the user table and my condition would match 3 million. I have gone thru…
0
votes
1 answer

Spring Boot+ MySQL: LAZY Loading issue - No operations allowed after statement closed

I implement a Dashboard functionality that checks every time at program start a list of Requirement-Objects for a bunch of different characteristics like progress, missing data and alike and sets for each characteristic a dedicated beacon on the UI.…
Alex
  • 1,387
  • 2
  • 9
  • 14
0
votes
1 answer

impossible to retrieve getGeneratedKey from a ResultSet, in an insert previously made in postgresql

I can not recover the generated id after inserting values in the "test" table Here the create script generated by pgadmi4 of the table "test": CREATE TABLE school.test ( test_id bigint NOT NULL DEFAULT…