jdbc « JDBC « JPA Q&A





1. Hibernate vs. JDBC    stackoverflow.com

I am working on a project that previously used Hibernate. Honestly, it seems like Hibernate complicates it more than JDBC would have. Also, it seems that a lot of the power ...

2. Middle ground between JDBC and Hibernate?    stackoverflow.com

We've been implementing Hibernate recently as a replacement for JDBC. What I like is not having to constantly write SELECT, UPDATE, INSERT statements and the associated PreparedStatement and ResultSet code. However we've been ...

3. Should I include main method for JPA?    stackoverflow.com

For the last three days i am learning JPA by various examples, to change my JDBC code to JPA. Every JPA example and tutorial have main method to run it. Of ...

4. Anyone ever used ha-jdbc with JPA?    stackoverflow.com

hi anyone ever tried using ha-jdbc with jpa? im trying to do so, and shamefully no example online. even a small example would be really appreciated. ps. im surprised people arent ...

5. Hibernate issues when upgrading from JDBC3 to JDB4    stackoverflow.com

Would there be a problem in Hibernate if upgrade from JDB3 to JDB4 is done? Does hibernate need to be updated also?

6. Java ETL process    stackoverflow.com

I have this new challenge to load ~100M rows from an Oracle database and insert them in a remote MySQL database server. I've divided the problem in two:

  1. a server side REST server ...

7. Q 4 C. Bauer & G. King (1): how Hibernate relates to JDBC    coderanch.com

hibernate uses JDBC to comunicate with the DB. when working with hibernate you do not care about JDBC, SQL, Connections and so on. Hibernate is a layer above all this and simplifies your life when storing/retrieving Objects from/to DB. For special cases you can still use a JDBC DB Connection to do some work on DB but the ideal case would ...

8. Hibernate Vs JDBC    coderanch.com

Hibernate will work fine with Oracle 9i (that's what my company uses). Since Hibernate uses JDBC, with enough time, work, and craftiness you should be able to hand-code JDBC to be faster than Hibernate. The trick, however, is that with a sufficiently complex application, the risks of making a mistake with JDBC are greater than with a tool like Hibernate, JDO, ...

9. JDBC and Hibernate    coderanch.com





10. When should I use JDBC and when to use Hibernate    coderanch.com

I can't seem to figure out how to implement UTF-16 CHARS using JDBC. Does Hibernate serialize objects and then allow the resulting data to be stored in a JDBC database? I worry about serializations that are stored on a disk or that may become different between client and server such as might be the case when using RMI. Is serialization a ...

11. hibernate for JDBC    coderanch.com

12. using JPA and JDBC together    coderanch.com

Hi, first, I'm a new member and I hope that my post is in the right section I want use EJB3 in my application but the problem is that I canno't map a table wich contains financial market data (over 100 000 rows per table), I need to extract them from the database to do some treatements and inject the result ...

13. JDBC OR HIBERNATE ?    coderanch.com

Hi there... As far as i know that JDBC is a API for working out Java Application with any database at hand. And Hibernate is a ORM solution. Please clarify the following questions: 1)How JDBC and Hibernate are related ? 2)Should i learn JDBC first and work on java applications.Then move to Hibernate. I am having basic knowledge of Oracle SQL ...

14. OJB or Hibernate    coderanch.com

15. hibernate vs JDBC    coderanch.com

We have a scnario where in once a week a batch program will run and it will process 2 million records. we have to retrieve them from a a file, store them in a table and process the records and update the table. For the database part, we are deciding whether to use the a OR mapping tool like Hibernate or ...

16. Hibernate VS JDBC    coderanch.com





17. Hibernate and Jdbc    coderanch.com

Thanks paul. Our application is built using JDBC calls for DB operations. We have included a third party jar file which will invoke an ejb deployed on a remote location. The ejb call will return results. Those results are saved by classes included in the third party jar. third party jar file is using hibernate to save the results in db. ...

18. converting from Hibernate to JDBC???    coderanch.com

At work we have tons hibernate stuff and JDBC stuff. What we are trying to do is find a simply way of taking the hibernate query and turning it into a JDBC query. Like taking a Criteria Object and turning it into a PreparedStatment JDBC object ? And visa versa. Any clues???

19. Do the Hibernate supports Msaccess    coderanch.com

20. Jdbc vs Hibernate support Jdbc    coderanch.com

Hibernate allows direct access to JDBC for the same reason it provides methods to run SQL directly: for the few cases where your specific application logic requires you do something with the database that cannot be done through Hibernate itself. For example, you might want to create database users in your application. The disadvantage is you tie your applciation into the ...

21. JPA vs Home Grown JDBC Wrappers    coderanch.com

Hi, Ive been through several of the posts in this forum on the performance advantages of JPA, over several other technologies. But, I still have a doubt on specific things, which is why I'm posting this question. I've been trying to implement a performance exhaustive application which needs to load data from tables, to a local cache. And, also provide interfaces ...

22. JDBC-hibernate    coderanch.com

We have all of our objects mapped to database tables. When we start the application it creates all of the tables and relationships and to date I have not written a single line of SQL except from what was required to create the database. Once mapped, you can do smple operations like select all, select by ID, save, update, delete with ...

23. Is JDBC faster than JPA?    coderanch.com

Yes, and no. Since this answer answers all comparative performance questions, I'll flesh it out a bit. JDBC requires more boiler plate code written so is liable to take longer to write in the first place and more effort to maintain. Given the trade off between the cost of hiring a developer against the cost of buying a more powerful computer, ...

24. illegalArgumentException, HSQLDB, and Hibernate    coderanch.com

Greetings, So I whipped up a java/swing/hibernate/hsqldb desktop app in Eclipse. pertinent.cfg.xml org.hsqldb.jdbcDriver false jdbc:hsqldb:data/smdv sa true thread org.hibernate.dialect.HSQLDialect [b]create-drop[/b] ...

25. hibernate lazy=False    java-forums.org

26. MSAccess and hibernate    java-forums.org

27. Hibernate Standards    java-forums.org

28. Hibernate doubt    java-forums.org

29. Some information about Hibernate    java-forums.org

30. question about hibernate    java-forums.org

31. Hibernate    java-forums.org

I have the follow problem with hibernate when I want to get data from db. the methods are : public static List getModulos(String idProject,Long[] modulosID){ Session session = SEPhibernate.getSessionFactory().getCurrentSession (); session.beginTransaction(); ModulosDAO dao = new ModulosDAO(session); List modulos=null; try { modulos = dao.getModulos(idProject,modulosID); } catch (Exception ex) { ex.printStackTrace(); } session.close(); return modulos; } public List getModulos(String project,Long[] modulosID) throws HibernateException ...

32. threads and hibernate    java-forums.org

I run a thread that makes connections with hibernate, they are querys of hibernate and if the table has been updated I insert records It works ok but when I execute the thread, after 2 minutes lost the database connection... do you know what is the problem? how can I fix? org.hibernate.exception.GenericJDBCException: Cannot open connection at org.hibernate.exception.SQLStateConverter.handledN onSpecificException (SQLStateConverter.java:91) at org.hibernate.exception.SQLStateConverter.convert( ...

33. Hibernate 3x with sub class    java-forums.org

34. Hibernate    java-forums.org

35. Problme avec Hibernate    java-forums.org

Hello all I have a problem with hibernate: I have installed Hibernate3 hibernate2 and I import them.But the problem persists at the session. My java code: import net.*; import org.*; import com.*; import java.util.*; import net.sf.hibernate.*; import com.test.java.hibernate.*; public class Test{ public static void main(String[]args) throws HibernateException{ //The method beginTransaction() is undefined for the type Session Session session=HibernateUtil.currentSession(); Transaction tx=session.beginTransaction(); TContact ...

36. hibernate execption    java-forums.org

37. Hibernate optimization    java-forums.org

38. Communication link failure using hibernate    java-forums.org

hi, I'm newbie with hibernate do you have any solution how to fix this error: WARNING: SQL Error: 0, SQLState: 08S01 SEVERE: Communications link failure Last packet sent to the server was 0 ms ago. Pls. take note that DB is on the other machine does it affects the connection. thnx.. server used: glassfish

39. Should I be using hibernate?    java-forums.org

Hi all. I am thinking of creating lesson management software for the school I currently work for. I wish the have all the individual pieces of a lesson stored in a MySQL database (eg. games, activities, etc) as well as schedules, messages and lots of other pieces of information. I have spent hours and hours writing SQL statements and converting datatypes ...

40. JPA/JPA2: please tell me if I understand this correctly.    java-forums.org

If I understand what I've been reading, entities can be detached from one EntityManager and merged into the persistence context of the same or a different EM. So multiple threads could conceivably operate on detached objects using ordinary Java synchronization, and then merge their changes later. I know there are a few things to watch out for if I do this. ...

41. Hibernate adding/overwriting records incorrectly    java-forums.org

I am a HIbernbate newbie and have a problem that has been bothering me for days. Here is a rundown of the issue I am having: 1. There is a @Entity class called Resource which contains a Key field and an ID field. 2. There is a @Entity class called Agreement which extends Resource. 3. There is a @Entity class called ...

42. JPA vs Hibernate    java-forums.org

Hi all, I'm thinking about building a application using just JPA instead of using JPA with Hibernate. My question is how can I access DB with just JPA? Do I have to use JDBC? From what I've been reading Hibernate "facilitates" JPA by providing a mechanism to communicate with DBs (among other things). thank you for reading EDIT: Ok, JPA is ...

43. Hibernate, help me    java-forums.org

44. xdoclet and hibernate    java-forums.org

Hi nick Java Code: /** * @hibernate.class table="table" */ public class ClasswithCompositeId { private ClasswithCompositeIdPk PK; /** * @hibernate.id generator-class="assigned" * */ public ClasswithCompositeIdPk getPK() { return this.PK; } public void setPK(ClasswithCompositeIdPk thePK) { this.PK = thePK; return; } } package saes.election.eligibleoption; import java.io.Serializable; import org.apache.commons.lang.builder.*; public class ClasswithCompositeIdPk implements Serializable { /** * The composed eligible option this role is ...

45. how to prevent autogenerated sqlstrings in hibernate ?    java-forums.org

Hi , I am new to hibernate I wish to know if anyone knows how to disable the sqlstrings generated by hibernate after reading the configuration files. The problem is that in my case there are huge no of fields in some of the tables and the the generated sql select , update etc query Strings are itself holding a huge ...

46. Hibernate Use    java-forums.org

Hi Every one, I am learning Hibernate.For this i am following tutorials form different websites.In every tutorial they gave examples for saving data or to update data.I couldn't find any examples for retrieving data(like retrieving a row depending on some condition ) .Now my doubt is,Can't we use hibernate for retrieving data form a table? If we can,how to do that ...

47. How hibernate uses JDBC internally or it uses its own Method    forum.hibernate.org

Hi I just want to know how hibernate able to connect to database without using JDBC. Because which ever the Database we use,we have to use JDBC to connect to that database but in hibernate we wont put any jdbc code. so please can any one explain what is the underlying technology hibernate uses to perform all the jdbc task. regards ...

48. Executing JDBC QUERRY    forum.hibernate.org

49. Combining Hibernate and JDBC    forum.hibernate.org

Hello, I'm currently working on a project using Hibernate, Spring, and some direct JDBC. In this project, we have a portion of the code that uses JDBC to persist data. Another part of the code uses Hibernate. We have a service which needs to call both within the same transaction. First, a JPA object is created for a new User object. ...

50. JDBC Username and Password    forum.hibernate.org

I have a situation where the JDBC connection isn't a static set of username and password, but that the actual user making the request is used to make the connection. Is it possible to pass the JDBC Connection Username and Password to Hibernate at runtime in the context or some other way?

51. How to handle timestamps with hibernate an ingres via jdbc ?    forum.hibernate.org

I have searched for the correct solution, but am not sure of the correct way of handling timestamps with nanos with hibernate. Hibernate version: 3.2.6, using JDK 1.4 java.sql.Timestamp handling Ingres Databas Version: , version: II 9.3.0 (int.w32/159) Ingres Jdbc driver version: Ingres Corporation - JDBC Driver, version: 3.4.9 I have now implemented the HibernateUTC UserType approach see: https://www.hibernate.org/100.html or https://www.hibernate.org/461.html ...

52. Using Hibernate for new enhancements with Existing JDBC Code    forum.hibernate.org

Hi Everyone, We have an application which is using JDBC and which uses an existing DataSource in websphere application server. We are getting new enhancements in our application and we are trying to use Hibernate for new enhancements. As our old code is still in JDBC and if we try to migrate new enhancements using hibernate and both will be using ...

54. user should provide JDBC Details. Please suggest.    forum.hibernate.org

Hi, I am new to Hibernate, Today i have configured my webapplication which is deployed on Tomcat to use Hibernate to update the database tables. I have provided all the configuration files, class files, Database tables. I have verified them many times for confirmation, still when i try to update the table with the values provided in the form, it is ...

55. Support for JDBC 3    forum.hibernate.org

56. Simple Jdbc    forum.hibernate.org

sounds all good.... ...but just to inform ya' ;) Stored procedures is now very possible to use by making a Custom ClassPersister (and the new possibility a Custom CollectionPersister)....at least to persist stuff (not query stuff ;) To query stuff via stored procedures (or by other means) we are very interested in making this possible/easier in hibernate. createSQLQuery() is one of ...

57. performace about jdbc and hibernate and jdbc from hibernate    forum.hibernate.org

hi , guys i used a hql to execute in hibernate Code: from Post as post inner join post.postContent inner join post.poster where post.thread.threadID = :threadid order by post.postTime it took 170 milliseconds it's too slow to my opinion , so i want to find out for why i got the sql from this hql , it is: [code] select post0_.postID ...

58. what's the difference between the jdbc and hibernate?    forum.hibernate.org

whe i use the connection which get from jdbc to call a procedure,it works well.but when i use the connection which get from Hibernate.getSession().connection(),it does't work.my code as follow: CallableStatement cs; try { cs = connection.prepareCall("{call sp_zyjs_match(?,?,?,?)}"); cs.registerOutParameter(4, Types.VARCHAR); cs.setInt(1,1); cs.setString(2, "1000000000"); cs.setString(3,"admin"); cs.execute(); String outParam=cs.getString(4); System.out.println("message = " + outParam); ...... the error is: java.lang.NullPointerException at oracle.jdbc.dbaccess.DBDataSetImpl._createOrGetDBItem(DBDataSetImpl.java:535) at oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java:1642) at ...

59. JDBC vs Hibernate    forum.hibernate.org

greetings, i did a battery of tests making sure that both hibernate an jdbc generate the *exact* same sql. the test case involves creating objects in various numbers. Code: Add objects (INSERT) Objects Hib JDBC 100 ...

60. Coexist Hibernate with Legacy JDBC code    forum.hibernate.org

Hello All: We have an Application that runs within the Tomcat container. The persistence layer is coded using JDBC. I have been looking into Hibernate and of course and very impressed. I would want us to move our persistence layer to use Hibernate. However I do not see getting permission to change the entire existing JDBC code to Hibernate. Not at ...

61. hibernate and Livelink (can I use other stores than JDBC?)    forum.hibernate.org

Hello, I am evaluating different options to have an object layer on top of opentext's livelink. While Livelink (at least our implementation) has an oracle backend, we are only (maximally) allowed to read from Oracle. To write, we are required to use the Livelink API (java API but not really object-oriented). So the question is: is it possible to use Hibernate ...

62. Forcing Hibernate to use the JDBC3 getGeneratedKeys() (?)    forum.hibernate.org

How can I force Hibernate to use the JDBC3 getGeneratedKeys() function? I'm using Informix 9.4, and I get always the following message in the logfile : ------------------------------------------ 09:01:10,403 INFO SettingsFactory:105 - Use JDBC3 getGeneratedKeys(): false ------------------------------------------ I'm using the following hibernate.cfg.xml : ------------------------------------------ java:comp/env/jdbc/Timesheet false