Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Database programming

Name: Anonymous 2009-09-07 14:21

G'day /prog/

I'm writing a java application with a mysql db backend (indeed, performance is not what I'm after), but I'm struggling a bit. How does one go about saving data? Do you execute an update query whenever a class representing a table is changed, or would there be an interval? Or am I going about this entirely wrong?
Your advice will be greatly appreciated.

Name: Anonymous 2009-09-13 16:35

>>22

At work, I work with .Net on DB2.

Our convention is to place all queries in a separate XML file. This allows you to get to them in (mostly) one place and lets us pass it off to other people so that they can rewrite or add new queries. We just load queries from the file using a utility class and execute them as needed.

A generic driver interface is fine (Java's JDBC, or .Net's OleDb/ODBC). Find a connection pooling class or write your own.

This is also related to the "should a noobie start with vim/javac or NetBeans Enterprise Deluxe Edition first?"  You need to learn SQL anyway. Otherwise, JPA will only confuse the hell out of you. Not to mention, you are a shitty programmer if you can only use ORM frameworks for databasing.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List