• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cleaner code or an alternative framework for JDBC

 
Danny Krinkle
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have written an application that queries databases and outputs a dashboard in excel format. The application works okay, but what I'm having problems with is the amount of code I have where my objects are made up of data from multiple databases across multiple servers - im sure there must be a neater way than what im doing, its just that with all the technologies available I dont really know where to start.

I have mix of objects, some objects can be mapped straight to tables, I do this using Hibernate. The tricky ones are built from JDBC code using sql queries such as this :-



In addition to the code to populate the objects, handle the connections and exceptions etc

My problem is maintaining the second method of getting the data and populating my objects, it just feels really sloppy and takes a lot of maintaining. I dont have control over the databases and the management team keep altering what data they want to see in the spreadsheet. Is there a way to acheive the same with Hibernate or is there an alternative JDBC framework I can utilise?

Kind Regards

DK
 
Prashant Hurria
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the problem lies solely with the Boiler Plate JDBC Code. Why dont you try Spring's JDBC Features.
 
Danny Krinkle
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Prashant Hurria wrote:If the problem lies solely with the Boiler Plate JDBC Code. Why dont you try Spring's JDBC Features.

Thanks Prashat,

Id forgotten about this post, thanks for the reply.

I eventually found the Apache DBUtils and opted for that.

Kind Regards

DK
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic