Solved

Need a MySql class template

Posted on 2009-05-18
9
191 Views
Last Modified: 2012-05-07
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
Comment
Question by:Mickeys
9 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 24410180
See the following and linked examples

http://www.exampledepot.com/egs/java.sql/ConnectMySql.html
0
 
LVL 26

Expert Comment

by:ksivananth
ID: 24410181
there are frameworks, try hibernate/ibatis!
0
 
LVL 92

Expert Comment

by:objects
ID: 24410182
commons dbutils has great helper methods

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

0
 

Author Comment

by:Mickeys
ID: 24410533
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 92

Expert Comment

by:objects
ID: 24410565
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
 

Author Comment

by:Mickeys
ID: 24410653
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
 
LVL 92

Expert Comment

by:objects
ID: 24410666
thats the source distro, theres also a binary distrubution that contains jar


0
 

Author Comment

by:Mickeys
ID: 24410707
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
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
ID: 24410734
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
wordmultiple challenge 12 116
java 8 lambda expresssions exception handling 3 72
Java JRE greater than 1.6 5 49
How to convert String matching to regex in java 4 16
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This video teaches viewers about errors in exception handling.

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now