• 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

Cleaner code or an alternative framework for JDBC

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic