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

Codeigniter 2 not returning from model as object only as result array

So, i've been using codeigniter for a while and I've never had an issue running a query in my model and returning it to my controller which then passes it into my view where I access it as an object, like so: MODEL (somemodel) function getdata() { …
user578994
0
votes
3 answers

How do I read a PL/SQL NUMBER into a Java ResultSet?

Our PL/SQL Database has three NUMBER variables that represent an exact Day, Month, and Year. I want to read those values into a String in Java to display, but rs.getString("[Number_field]") trhows an "Invalid Column Name" exception, and…
Zibbobz
  • 725
  • 1
  • 15
  • 41
0
votes
0 answers

Concurrency issues in java accessing Jdbc Impala

What I want to do: Have two thread t1,t2 where t1 connecting to I1 impala cluster and t2 connecting to I2 Both t1 and t2 has the task of executing set of queries in the respective databases. Below is the pseudo code: …
Zara
  • 33
  • 1
  • 7
0
votes
1 answer

ResulSet web services call error resulset close

I have developed a method that returns the resultset of the query I pass method: public ResultSet executeQuery(String query) { ResultSet rs = null; try { stmt = _conn.createStatement(); rs = stmt.executeQuery(query); …
mego
  • 3
  • 3
0
votes
1 answer

Mongo aggregaton does not return whole result only a part of it

Can somebody tell me please where is the problem in this simple aggregation command: db.test.aggregate([ { $group: { _id: "$type", numbers: { $sum: 1 } } } ]).pretty() Collection has about 2…
Čamo
  • 3,863
  • 13
  • 62
  • 114
0
votes
0 answers

MySql count (*) returns different values in ResultSet and WorkBench

I have a query which has 4 Left Joins over 4 different tables. When I run this query in the workbench with a count() it returns 2 which is the expected value. The same query when running through my code returns 3000 i.e. count() as rowCount has a…
Guru
  • 45
  • 7
0
votes
1 answer

Spock testing a ResultSet in Groovy

Here is what I have so far: def "If there are results then return true otherwise return false"() { given: ResultSet resultSet = Mock() expect: resultSet.next() } I am trying to test a boolean method checkIfRowExists(int id, int…
ShadyBears
  • 3,955
  • 13
  • 44
  • 66
0
votes
0 answers

Resultset is writing more records in the csv

I'm trying to read data from table which is having ~13 million records. I used setFetchSize to read the records in batch wise doing some lookups and writing it to csv file. But output csv is generating with more than 50 million records which is not…
marjun
  • 696
  • 5
  • 17
  • 30
0
votes
0 answers

Why am I getting java.sql.SQLException: Operation not allowed after ResultSet closed?

Today While developing a piece of code to fetch user details from the database on execution of a stored procedure i have came across the following exception - Exception java.sql.SQLException: Operation not allowed after ResultSet closed at…
Arindam Das
  • 206
  • 1
  • 7
  • 29
0
votes
0 answers

java.sql.SQLException: Column 'grade' not found

i have 3 tables user(id,name), course(id,name) and users_courses(user_id,course_id,grade) and i used this query (which works on phpmyadmin) in DbCourse.java private final String GET_STUDENT_COURSES = "select * from users_courses where user_id…
0
votes
1 answer

how rs varaiable of result set rs.next() is true even if their is no record in second table b

table a roll 101 table b enter code hereempty set //code of java netbeans //table a public void t1() { try { String s1 = "select max(roll) as 'rn' from a;"; rs=stmt.executeQuery(s1); …
Anurag Rao
  • 107
  • 2
0
votes
2 answers

Is it better to use ResultSet.getString() or ResultSet.getTimestamp() to get a timestamp?

In retrieving a timestamp from Postgres or Oracle -- let's call it startDate -- is it better to use the resultSet.getString("startDate") call or resultSet.getTimestamp("startDate")? Currently I'm using resultSet.getString("startDate") and it works…
ktm5124
  • 11,861
  • 21
  • 74
  • 119
0
votes
2 answers

ResultSet.next() not selecting jPasswordField && jTextField

Im creating a log in page at the moment however everytime I try to "login" I get the "Your username and password dont match" message even if the Username and password are valid and stored in the database. I can't figure this out at all even from…
Dzl
  • 49
  • 8
0
votes
1 answer

Java/Eclipse - Result Set and Object class constantly overwriting

I have an issue which I cannot sort out. I've been working on it for a few days but cannot manage to find the issue. I am using MySQLWorkBench to both insert and retrieve/read data from. (Just to let you know where I'm getting the data from). The…
0
votes
2 answers

SSIS : Using SQLStatement output records as Full Result Set to feed into for each loop container

I am trying to use the output of a SQLStatement with Full Result Set Resultset from a SQL Task as an object to feed into foreach loop container. The SQL statement is SELECT * FROM INFORMATION_SCHEMA.TABLES where TABLE_NAME like 'Dim%' I want to…