Link to home
Start Free TrialLog in
Avatar of Mickeys
MickeysFlag for Sweden

asked on

Need a MySql class template

I am looking for at template class that connects to a sql server and can get, store and update the database. Is there a template anyone know off?
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

See the following and linked examples

http://www.exampledepot.com/egs/java.sql/ConnectMySql.html
there are frameworks, try hibernate/ibatis!
commons dbutils has great helper methods

http://commons.apache.org/dbutils/

Avatar of Mickeys

ASKER

well the first link was how to connect to a sql server. But what about reading, writing an update?

The other two....how does that work? I have to include some new package or what?
dbutils provides utility methods that can take some of the repetitiveness out of jdbc coding.
there isn't really a template than you can use, not any that are worth using anyway. Most end up making your code more complicated than it needs to be.
Avatar of Mickeys

ASKER

might be a stupied question but when I download the package I get commons-dbutils-1.2-src.....shouldnt I get some kind of package.jar??? I cant just add that folder. That will give error
thats the source distro, theres also a binary distrubution that contains jar


Avatar of Mickeys

ASKER

aha. So all I do is download that package. Take out the xx.jar and add it to my project. Then I use the example code to make it work?
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial