File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to write database agnostic/independent code in Java ?

 
David Jason
Greenhorn
Posts: 27
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Each database has its own characteristics and the same SQL statements will not necessarily work on all of them.
In that case, it it seems better to write code for each database instead of one big class that can handle all databases.
Is it possible to make your code database agnostic ? If so, how can we do that ?

 
Dielson Sales
Greenhorn
Posts: 4
Chrome Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Jason wrote:Is it possible to make your code database agnostic ? If so, how can we do that ?


You can take a look at Hibernate (Java). It can generate the SQL queries depending on the driver used, hence making your code portable to any supported SQL database.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic