Updated DeviceTypeDAOImpl.java

4.x.x
dilanua 10 years ago
parent 31df614418
commit 851fb35554

@ -67,7 +67,7 @@ public class DeviceTypeDAOImpl implements DeviceTypeDAO {
Connection conn = null; Connection conn = null;
PreparedStatement stmt = null; PreparedStatement stmt = null;
ResultSet rs = null; ResultSet rs = null;
List<DeviceType> deviceTypes = null; List<DeviceType> deviceTypes = new ArrayList<DeviceType>();;
try { try {
conn = this.getConnection(); conn = this.getConnection();
String sql = "SELECT ID AS DEVICE_TYPE_ID, NAME AS DEVICE_TYPE FROM DM_DEVICE_TYPE"; String sql = "SELECT ID AS DEVICE_TYPE_ID, NAME AS DEVICE_TYPE FROM DM_DEVICE_TYPE";
@ -75,7 +75,6 @@ public class DeviceTypeDAOImpl implements DeviceTypeDAO {
rs = stmt.executeQuery(); rs = stmt.executeQuery();
while (rs.next()) { while (rs.next()) {
deviceTypes = new ArrayList<DeviceType>();
DeviceType deviceType = new DeviceType(); DeviceType deviceType = new DeviceType();
deviceType.setId(rs.getInt("DEVICE_TYPE_ID")); deviceType.setId(rs.getInt("DEVICE_TYPE_ID"));
deviceType.setName(rs.getString("DEVICE_TYPE")); deviceType.setName(rs.getString("DEVICE_TYPE"));

Loading…
Cancel
Save