package LinkFuture.Core.DBHelper;

import LinkFuture.Core.DBHelper.Model.DBTypeInfo;
import LinkFuture.Core.DBHelper.Model.SPInfo;
import LinkFuture.Core.Utility;
import LinkFuture.Init.Debugger;

import java.sql.SQLException;
import java.sql.Statement;

/**
 * Created by Cyokin
 * on 2/6/2015.
 */
public class DBReader {
    protected SPInfo spMetaInfo = null;
    protected Statement statement = null;
    protected DBTypeInfo DBType = null;
    public DBReader(Statement statement,SPInfo spMetaInfo){
        this.spMetaInfo = spMetaInfo;
        this.statement = statement;
        try {
            this.DBType = Utility.enumParser(DBTypeInfo.class, this.statement.getConnection().getMetaData().getDatabaseProductName());
        } catch (SQLException e) {
            Debugger.fatal("can't get DB type",e);
        }
    }
}
