package realcix20.classes.basic;
import java.sql.ResultSet;
import realcix20.utils.DAO;
public class ColumnManager {
private final static String SELECT_COLUMN_SQL = "SELECT * FROM CLSTABLESFIELDS WHERE TABLENAME=? AND COLUMNNAME=?";
public static Column getColumn(String tableName, String columnName) {
Column column = null;
DAO dao = DAO.getInstance();
dao.query(SELECT_COLUMN_SQL);
dao.setString(1, tableName);
dao.setString(2, columnName);
ResultSet rs = dao.executeQuery();
try {
if (rs.next()) {
int clsId = rs.getInt("CLSID");
column = new Column(clsId, tableName, columnName);
}
rs.close();
} catch (Exception e) {
}
return column;
}
}