Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 229
  • Last Modified:

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?
0
Mickeys
Asked:
Mickeys
1 Solution
 
CEHJCommented:
See the following and linked examples

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

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

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
MickeysAuthor Commented:
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?
0
 
objectsCommented:
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.
0
 
MickeysAuthor Commented:
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
0
 
objectsCommented:
thats the source distro, theres also a binary distrubution that contains jar


0
 
MickeysAuthor Commented:
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?
0
 
objectsCommented:
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now