Skip to main content

Posts

Showing posts from July, 2012

Simple Java Project with DB

Hi Guys.. Recently I have got question from my friend who is preparing for java test. He asked me to develop simple Java database project to retrieve and display table records from a particular table. Here I have used MySql as the DB and used JSTL as well. To run this project java mysql driver and jstl jar files should be available in the WEB-INF/lib folder. Here is DAO class package tc.com.dao; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import java.util.List; import tc.com.db.ConnectionFactory; import tc.com.dto.Employee; public class EmployeeDAOImpl { Connection connection; Statement stmt; public EmployeeDAOImpl() { } private static Connection getConnection() throws SQLException, ClassNotFoundException { Connection con = ConnectionFactory. getInstance().getConnection(); return con; } p...