Package realcix20.classes.basic

Source Code of realcix20.classes.basic.ColumnManager

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;
           
        }
}
TOP

Related Classes of realcix20.classes.basic.ColumnManager

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.