资 源 简 介
Introduction
This is a common DaoHelper for multiple purposes on java apps. I provide a DBConnection class too, that provides the connection with the database.
It is required the correct driver to do that, i.e: mysql connector
Usage
1) Create a Java application project.
2) Add DaoHelper.java and DBConnection.java
3) Customize DBConnection.java with your db connection data.
4) From any class you could do this...
```
try{
QueryParameters params = new QueryParameters() {
public void setParameters(PreparedStatement pst)
throws SQLException {
pst.setString(1, "Cristian");
}
};
String query = "SELECT * FROM USERS WHERE USERNAME = ?";
List users = new DaoHelper().executeQuery(
query, params, new ResultReader() {
public String getResult(ResultSet result)
throws SQLExcep