resultset « JDBC « JPA Q&A





1. How to uniquify resultset from NHibernate    stackoverflow.com

Hi I have this multi-criteria, which works very well, except that I'm getting multiple of the same entities in the collections. I know this is by design, and I know you ...

2. Hibernate: Multiple Result Sets    stackoverflow.com

from what I've read in the Hibernate documentation/online it sounds like Hibernate does not have the ability to handle multiple result sets. I'm looking to make a MySQL DB call ...

3. How to get ResultSetMetaData from enity manager?    stackoverflow.com

Is there a way to get the MetaData of the result returned by executing a nativeQuery on an Entity Manger in JPA?

4. Hibernate, ResultSet and PrepareStatement    coderanch.com

Hmm. That's interesting, and not how I understand it should work (though admittedly I'm getting this understanding from documentation, rather then playing with the code). Here's an idea: if you are worried about the Connection, why use one? You could just use createSQLQuery(). [ June 23, 2006: Message edited by: Paul Sturrock ]

5. limit on resultset in sapdb using hibernate    forum.hibernate.org

Hi Everyone, Please help.... I'm using hibernate to connect sapdb. I have a requirement to get limited records for pagination purpose. i.e. limit 0-10(first 10 records), 10-20 (second 10 records)... I've tried Criteria and Query objects by setting startIndex, maxResults but throwing exception 'com.sap.dbtech.jdbc.exceptions.DatabaseException: [-3008] (at 610): Invalid keyword or missing delimiter'. How can I achieve this?? Thanks in adv.. ~karna ...

6. UserType resultset values    forum.hibernate.org

I am trying to create a custom usertype that creates a hashmap of all the columns on a table. The problem is the ResultSet parameter of the nullSafeGet only has the columns that have been specified. Is there any way to get all the columns of the tabled added when I dont know what columns are there? Thank you in advance. ...

7. Resultset with actual objects and not the proxies    forum.hibernate.org

Is there any way that the results that are returned by hibernate (.list() or .uniqueResult) dont have any proxy for lazy initialization? I can do lazy="false" but i dont want it due to design constraints. Similarly I can test individual fields whether they are instanceof HibernateProxy and if they are, I can use 'proxy.getHibernateLazyInitializer().getImplementation()' BUT this seems not to be a ...

8. Large resultsets    forum.hibernate.org

What is the recommneded way to retrieve large result sets ? For example, I have a table that has 100,000 rows and I would like to be retrieve 50 rows, display them to the user, and allow them scroll thru the remaining rows. What are the appropriate hibernate api's that are recommended for this siduation? thanks, Adam

9. No ResultSet set was produced.    forum.hibernate.org

Exception in saving object. Code: java.sql.SQLException: [Microsoft][SQLServer JDBC Driver]No ResultSet set was produced. Hibernate debug log: Code: 2004-02-25 14:42:47,757(2140) [main] DEBUG net.sf.hibernate.impl.BatcherImpl - about to open: 0 open PreparedStatements, 0 open ResultSets 2004-02-25 14:42:47,757(2140) [main] DEBUG net.sf.hibernate.SQL - insert into de_purchase_order (PO_NO, INVOICE_NO, ORDER_DATE, CUSTORMS_DECLARATION_NO) values (?, ?, ?, ?) select SCOPE_IDENTITY() Hibernate: insert into de_purchase_order (PO_NO, INVOICE_NO, ORDER_DATE, ...





10. Slow initializing of object from ResultSet    forum.hibernate.org

Hi I'm doing some speed-testing on Hibernate vs. my companys old databaseservice, and experiencing some slow behavior from Hibernate. When trying to load 256 objects from my database, Hibernate seems to take some time at initializing the object.. I'm using: * Hibernate 2.1.3 * MSSQL Server (Remote location) * JTDS v. 0.8 A small clip from my log4j output: 12:02:55,404 DEBUG ...

11. How to hydrate a ResultSet?    forum.hibernate.org

12. Getting resultset values by String?    forum.hibernate.org

Gavin, I found some references to folks who were suggesting that you not fetch values from JDBC via column name. It definitely does seem to be making a difference in performance for me (I'm using postgres 7.4.5). Are you planning on implementing a change for this soon? Maybe it's in 3.0 already, I haven't checked.. (I'm using hibernate 2.x still) Thanks, ...

13. getting resultset    forum.hibernate.org

Hibernate version: 2.17 I am trying to introduce the Hibernate with our existing system. One of the existing components needs data in a result set while the data i am getting from Hibernate is object. My question is how can I do it ? Even if I write a SQL query and call it through session.createSQLQuery() method, I got objects as ...

14. FYI: UserType, nullSafeGet and resultSet.wasNull() check    forum.hibernate.org

[b]Hibernate version:2.1.7[/b] [b]Name and version of the database you are using:Oracle 9[/b] In case of coding a UserType "Hibernate in Action" proposes a immediate resultSet.wasNull() check on entry of UserType.nullSafeGet. It would look like [code] public Object nullSafeGet(ResultSet inRSet, String[] inNames, Object inOwner) throws HibernateException, SQLException { if (inRSet.wasNull()) { return null; } [/code] This fails whenever you have a Select ...

15. Hibernate to return RowSetDynaClass (or ResultSet)    forum.hibernate.org

I should convert an existing API (which is already in product use) to use Hibernate instead of plain SQL in the code (quite ugly!!). At the moment the API is implemented so that it retuns RowSetDynaClasses as the query results. I was wondering if there's any way to implement this using Hibernate? I tried to read the documentation but couldn't find ...

16. ResultSet don't init value    forum.hibernate.org

Hibernate version:3 hi boys, I don't succeed in understanding a thing, I have a simple chart with a composite-id. When I do a simple Code: Session session = AS400Session.currentSession(); Query sql = session.createQuery("from CCicliMisureVO as ay where ay.pk.stagcz=? and ay.pk.modecz=? and ay.pk.matecz=? "); sql.setString(0, pf.getPfvopk().getStagpf()); ...





17. Taking a lot to translate resultset to objects    forum.hibernate.org

Hi, I'm executing a query that returns quite a good quantity of rows (almost 1200). The problem is that Hibernate is taking a lot to translate the recordset to object instances. According to this benchmark: Description of CPU usage for thread main 100.00% - 7752 ms - sun.reflect.DelegatingMethodAccessorImpl.invoke() 100.00% - 7752 ms - sun.reflect.NativeMethodAccessorImpl.invoke() 100.00% - 7752 ms - ar.com.tsoluciones.emergencies.test.InboxManagerServiceTestCase.main() 100.00% ...

18. Smart retrieving of large resultset (100,000+ records)    forum.hibernate.org

Hi, I've got an application which handles some table with quite a lot of records (1,000,000+). I've got an user interface where the user can make queries on this table which could return quite a lot of results. The results are displayed in a pageable behaviour, so I actually need the first few records (i.e. 10) and the other objects could ...

19. ResultSet with Hibernate    forum.hibernate.org

20. Resultset metadata    forum.hibernate.org

I assume you want the equivalent of ResultSetMetaData in JDBC? The JDBC ResultSet looks inaccessible to me if you're using Hibernate Query. So that means you can't get the ResultSetMetaData. It looks to me like you'd have to get the JDBC connection from the session and execute the query yourself in order to have access to that interface. I'm curious about ...

21. How can we convert ResultSet of MySQL into XML    forum.hibernate.org

22. Hibernate usage of resultSet    forum.hibernate.org

I have a small test app that persists a few hundred instances of a simple class and then performs a simple query to load them back. I have another test app that uses straight JDBC and does the same thing (ie. stores a few hundred records and then loads them back and goes through the result set and marshalls the data ...

23. How to get resultset as XML    forum.hibernate.org

24. Stored Prodcedure returns same item in resultset    forum.hibernate.org

Hi, I'm trying to get results from a stored procedure. Everything works fine, except for 1 thing: The resultset gives the correct number of results but the items in the resultset are all the same (first element of resultset). Can anyone help me here? Hibernate version: version 3.1.3, March 20, 2006 Mapping documents:

26. Setting ResultSet to a single Object    forum.hibernate.org

I am trying to retrieve some fields from multiple tables(i.e. multiple objects) and want to set that ResultSet into a single object by using hibernate. e.g. (select a.x,b.y from AVO a,BVO b where a.z = b.z and a.m = 12;) i want to get a.x,b.y in form of an object. How can i do it?????

27. ResultSet leak when using wrap_result_sets    forum.hibernate.org

org.hibernate.dialect.SQLServerDialect @aims.db.name@ dbo jdbc:@jdbc.vendor@://@aims.db.server@/@aims.db.name@:@aims.db.port@ @aims.db.user@ @aims.db.password@ @jdbc.class@ false after_transaction true true ...

28. How to put the resultset in a JTable    forum.hibernate.org

29. nullSafeGet resultSet.wasNull() should NOT be used    forum.hibernate.org

Hibernate version: 3.2.1.ga Database: MySQL - innodb 5.x Following the Hibernate examples, wasNull below should tell me if the value from the database for this column is null. public Object nullSafeGet(...) throws SQLException { if (resultsSet.wasNull()) return null; .... } However, in my example at least, the test is for the WRONG column, the previous and not the current one. The ...

30. Updatable resultsets    forum.hibernate.org

Hi All, I would like to know if anyone has tried to use updatable resultset with Hibernate. I have a scenario where in we need to show a resultset (list) on the front end, make this modifiable & then save those changes & refresh the list. If any one has worked on the same do share your thoughts. I am using ...

31. Newbie: Transform resultset    forum.hibernate.org

Hm, I really don't know, never tried this. I'm using hibernate more as JPA implementation. But try to define the alias by yourself and change the method accordingly. Also you can try the projections, I really have no experience with it. I would also like to know, what helped :-). Regards, Pavol

32. Resultset    forum.hibernate.org

I am confonting an identical problem. I'd like to execute my query through Hibernate (since I already have it configure), but interfaces to other JAR's require a java.sql.ResultSet parameter . . . I can't seem to find any info. Why, might I ask, did Hibernate implement a custom ResultSet interface (ScrollableResults) instead of using java.sql.ResultSet?

33. How to set the resultset size    forum.hibernate.org

How can I set the number of items are returned back from an associated collection fetch when the parent object is retrieved with session.get or session.load? I have a class called Album which contains an association to Artists (via one-to-many using a linking table) and some albums will have 20+ artists. When I retrieve it with 'album.getArtists' (where album was loaded ...

34. Why is the ResultSet Processing by the Loader so slow?    forum.hibernate.org

Hibernate/Spring - It takes 16 ms to execute the query, but 12 secs to process the ResulSet of 307 rows (13 columns, DB2 mostly String). This is what I get from the Logs: [10/17/08 14:52:03:789 EDT] 00000056 SystemOut O 2008-10-17 14:52:03,789 DEBUG SessionImpl - opened session at timestamp: 12242695237 ... ... [10/17/08 14:52:03:805 EDT] 00000056 SystemOut O 2008-10-17 14:52:03,805 DEBUG ConnectionManager ...

35. equivalent to ResultSet.executeUpdate()    forum.hibernate.org

Hai In Hibernate we are trying to insert data to database in DAO layer of our application my query is in simple JDBC Program we can make sure that datas are inserted or not by using the ResultSet.executeUpdate() (which will return number of rows updated or deleted for the update and delete operation) In hibernate program how can i make sure ...

36. Help! : ResultSet is from UPDATE. No Data.    forum.hibernate.org

Author Message anubisza Post subject: Help! : ResultSet is from UPDATE. No Data. Posted: Thu Jan 29, 2009 10:17 am Newbie Joined: Thu Jan 29, 2009 10:03 am Posts: 5 Hi All, I have a website written using Struts 2, on a MYSQL database, using Hibernate.. I have a search function which calls a stored procedure in the database ...

37. ResultSet from Hibernate    forum.hibernate.org

38. Restrict Resultset    forum.hibernate.org

Hi newbie to hibernate and just wanted to get your thoughts on the following: I have a POJO called Client that contains all information about a client ie.: firstname, surname, dob... etc. I implement a search functionality that search for clients by Surname but when I view the sql generated by hibernate i noticed that hibernate fetches all fields defined in ...

39. resultset metadata using Hibernate    forum.hibernate.org

Hi, we are using Hibernate v3.3.1 in our projecet, iam trying to exeucte SQLquery and get metadata of the result. below is the code SQLQuery Tqry=Tsession.createSQLQuery("select * from Test"); Type Ttype[] = Tqry.getReturnTypes(); String Tname = Ttype[0].getName(); iam getting the following exception: java.lang.UnsupportedOperationException: not yet implemented for SQL queries I see the method in API, please let me know if iam ...