Questions tagged [cachedrowset]

57 questions
1
vote
1 answer

How to populate 2 CachedRowSet with the same ResultSet?

I need help with duplicating a ResultSet using CachedRowSet or any other way possible. I'm at this point ResultSet rs = stmt.executeQuery(query); CachedRowSetImpl crs = new CachedRowSetImpl(); crs.populate(rs); How would one populate a different…
Princesden
  • 33
  • 1
  • 4
1
vote
3 answers

Method for SELECT in java: what to return and how to close resources?

I am new to Java. I'm trying to create a class containing some utility methods for SQL operations in Java 1.6 to be used for general purposes. I have written down a selectMethod for getting the results of a SELECT on the DB. Problem: if my…
1
vote
0 answers

Errors on newFactory() when using RowSetProvider

Trying to create a CachedRowSet from a ResultSet in Netbeans11.2 (java) but error occurs finding newFactory() in the RowSetProvider class. i.e. RowSetFactory factory = new RowSetProvider.newFactory(); errors on newFactory. I have imported -…
RustyWire
  • 11
  • 2
1
vote
1 answer

LEFT OUTER JOIN on CachedRowSet

I would like to perform left join on two CachedRowSet. Seems like JoinRowSetImpl only supports INNER JOIN. What can I use to get left join working? Thanks and regards.
M J
  • 11
  • 3
1
vote
0 answers

CachedRowSet always returns empty

public CachedRowSet execute(String asql) throws ServiceUnavailableException { try (Connection connection = getDatabaseConnection(); Statement statement = connection.createStatement();) { try (ResultSet resultSet =…
Teddy
  • 11
  • 3
1
vote
1 answer

Oracle 1.8 CachedRowSet.populate error where select systimestamp from dual

I have a simple question... Why this code below is not working? JDK version: 1.8.0_92 Oracle DB version: 11.2.0.1.0 Oracle JDBC driver: ojdbc6.jar ---> I could not find this java code source :( String SQL = "select systimestamp from…
Jefferson
  • 180
  • 1
  • 2
  • 8
1
vote
0 answers

How to stop or cancel a pending OracleCachedRowSet execution?

Assume the following scenario: Create an OracleCachedRowSet instance using oracle.jdbc.driver.OracleDriver then call execute() using a background worker. Assume that the SQL command is time consuming. Now, while this instance is still executing, how…
Leet-Falcon
  • 2,107
  • 2
  • 15
  • 23
1
vote
1 answer

Does jooq offer a class similar with DataTable in C# to load data from ad-hoc queries?

Does jooq support running ad-hoc queries? I was wondering if it provides a data structure, similar with the C# DataTable (or the java CachedRowSet) where I can store the data from a query and which would support the different RDBMSes features such…
boggy
  • 3,674
  • 3
  • 33
  • 56
1
vote
2 answers

Can anyone explain the usecase of jdbc resultset getTimestamp(int,calendar)?

I'm talking about this interface method: http://docs.oracle.com/javase/7/docs/api/java/sql/ResultSet.html#getTimestamp%28int,%20java.util.Calendar%29 The most commonly used implementation being the one in…
YMA
  • 259
  • 3
  • 14
1
vote
0 answers

Add ArrayList to CachedRowSet or JoinRowSet using Lambda?

I have a JoinRowSet (jrs) and TreeMap (finalTM). I have a for-loop cycle on the keys of the TreeMap and, for each key, I want to get the records from the JoinRowSet that have this column equal to the value of the TreeMap key, using Java 8 lambda…
1
vote
2 answers

CachedRowSet failed to insert row

I'm using CachedRowSet. But when I call the insertRow() method, there is a SQLException failed to insert row. Here is my code: static final String DATABASE_URL = "jdbc:mysql://localhost:3306/javapos"; static final String USERNAME = "root"; static…
ram
  • 29
  • 10
1
vote
1 answer

Having image in netbeans JavaDB database or SqlLite

How can insert and retreive an image in netbeans javaDB database (the one used under services tab/ Or SqlLite). What type will the attribute type be? and how can I get it using CachedRowSet? In case this is needed JavaDB installation:…
Abdul Rahim Haddad
  • 689
  • 1
  • 8
  • 14
1
vote
2 answers

How to insert a row into a that table has an increment id with CachedRowSet?

I'm trying to insert a row into a table that has an increment id with CachedRowSet(I'm using Java wit Java DB), but I got the following SQLException: java.sql.SQLException: Failed on insert row at... SQLState: null Error Code: 0 Message:…
SamWang
  • 11
  • 3
1
vote
1 answer

How can i get whole date and time data when using cachedrowset from Oracle date field

I get data from oracle with result set and then populate them to cachedrowset. But when I get a date field in database and print it, it only print the date. I check the api and know that the getDate() method return java.sql.date,and time of sql.date…
Jadic
  • 33
  • 1
  • 7
1
vote
0 answers

Cannot use pointer on FilterRowSet?

I'm trying to use FilterRowSet to filter the appropriate values from database query. This is my code: // Initialize FilteredRowSet rowset = new FilteredRowSetImpl(); // Set the query string rowset.setCommand("SELECT * FROM…
Duy Tran
  • 85
  • 1
  • 2
  • 9