public DBI(String sql){
  _con=null;
  _pst=null;
  _rs=null;
  _sql_cmd=sql;
  String USER="";
  String PASSWORD="";
  try {
    Class.forName("com.mysql.jdbc.Driver");
    _con=DriverManager.getConnection(URL,USER,PASSWORD);
    _pst=_con.createStatement();
    _rs=_pst.executeQuery(_sql_cmd);
  }
 catch (  SQLException se) {
    se.printStackTrace();
  }
catch (  Exception e) {
    e.printStackTrace();
  }
}

public DBI ( String sql ) { _con = null ; _pst = null ; _rs = null ; _sql_cmd = sql ; String USER = "" ; String PASSWORD = "" ; try { Class . forName ( "com.mysql.jdbc.Driver" ) ; _con = DriverManager . getConnection ( URL , USER , PASSWORD ) ; _pst = _con . createStatement ( ) ; _rs = _pst . executeQuery ( _sql_cmd ) ; } catch ( SQLException se ) { se . printStackTrace ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } }
execute mysql query , get result set _rs
