• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using any database.

 
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I am attempting to write a Java application that could run on any database. But anyone who was worked with JDBC know this is not as easy as people make out. Diffrent database vendors support diffrent parts of the SQL standard.
The application is not on application server so I can not use CMP or JDO. So I am in the process of writting diffrent classes to support diffrent database.
Does anyone know of any useful tools that could help me?
Thanks
Chris.
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I suggest you checkout a good ORM tool. They tend to support a large myriad of databases right out of the box, though even that is no guarantee that you won't need to do a little extra work and a lot of extra testing.
As to which ORM tool... my personal favorite is Hibernate.
 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what do you need to do that cannot be done in jdbc? i know that each rdbms has *some* vendor-specific sql, but i've been able to write sql that avoids this for a lot of the applications i work on, once the tables were created.
 
Chris Harris
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
What is the advatage of using a ORM over a JDO? I am currently looking at hibernate and CastorJDO.
Is JDO only supported within open source database? As the castor site does not mention major database systems,
Thanks
Chris
 
john guthrie
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
castor jdo precedes java's jdo, and therefore is not an implementation of java jdo.
in my opinion, jdo is still a fairly new untested technology. i played around with the reference implementation a few months ago and was not wowed by it. i had a lot of trouble getting the code modification stuff (enhancement, i think its called) to work. i'm sure it was my goof, but it was not very informative in telling me what was wrong.
most useful (java) jdo implementations, afaik, are not free. i see that there *is* one open source implementation on sourceforge, though
tjdo
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There may be instances, where you would need :
  • DataBase Specific Calls e.g Getting Database date/timestamp
  • Vendor Specific Calls


  • In such a case you could store the Query Statements in either:
  • A table of the database.
  • In Memory Location of the application, which loads on start e.g. a HashTable which could be initialized on startup using static {} of the class.

  •  
    Chris Harris
    Ranch Hand
    Posts: 231
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Am I right in thinking that JDO is a type of ORM?
    I just don't see the difference.
    If I have missed the point, please say.
    Thanks
    Chris.
     
    Chris Mathews
    Ranch Hand
    Posts: 2713
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Originally posted by Chris Harris:
    Am I right in thinking that JDO is a type of ORM?


    Yes... and unfortunately no. Every JDO implementation that I know of (excluding the RI) supports Object-Relational Mapping. However, the JDO specification does not mandate this supports nor does it define a standard way in which to handle the mappings. This is my major problem with the current JDO Specification and it will definitely be addressed in the next version.
    [ February 10, 2004: Message edited by: Chris Mathews ]
     
    Chris Harris
    Ranch Hand
    Posts: 231
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    My main concern about JDO is that it will become available only within a container. Much of the JDO documentation is forecast on using with J2EE. However there are still many people writing J2SE programmes that would benefit from JDO.
    I am still unsure which JDO tools can only be used in J2EE.
    Chris.
    reply
      Bookmark Topic Watch Topic
    • New Topic