• 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

jdbc connections

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
in my application i need to deal with different databases. can u suggest me which is the best way .

regards,
satish
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thinkofsatish
Welcome to JavaRanch!

We're pleased to have you here with us in the servlets forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

You can change it here
 
author
Posts: 4335
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by satish kumar bairi:
hi all,
in my application i need to deal with different databases. can u suggest me which is the best way .

regards,
satish



Its nearly impossible to design a large-scale application that works indepentently of the database being used. Sure, there are ways to make database transitions less painful, but its rare to find a system that can completely switch back and forth between database types with optimal performance.

Some of those ways are... using standard JDBC drivers and don't use any database-dependent calls. I good example of this is trying to determine whether an insert statement generated any keys. Any JDBC-provided solution is often non-standard. You could also try an object oriented model like JDO/Hibernate, but then you may be spending a lot of time updating XML files instead of Java Code.

The real problem is that often times, to achieve realistic performance, you are forced to write direct SQL statements that are DBMS specific. One solution for this is to use a factory pattern. For example, have a DAO interface and implement that interface for a specific database type. This is generally a very good solution although it means anytime you want to add a new database to the mix, you have to re-implement a new set of DAOs (which can be very time consuming).
[ June 05, 2006: Message edited by: Scott Selikoff ]
 
The City calls upon her steadfast protectors. Now for a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic