tgt; comboSelectClient ()
{conn=null; .sql.Statement S; result=null; rs=null; lt; DS_Client gt; list=new ArrayList lt; DS_Client gt; (); _ Client ds;
{. forName ( com.mysql.jdbc.Driver ). newInstance ();=DriverManager.getConnection (DB_HOST, DB_USER, DB_PASSWORD);=conn.createStatement ();
queryStr= call ComboSelectClient () raquo ;;=S.executeQuery (queryStr);=result.getMetaData ();
(result.next ())
{= _ds.new DS_Client () ;. fname=result.getString ( FName ) ;. mname=result.getString ( MName ) ;. lname=result.getString ( LName ) ;. idClient=result.getInt ( id_client ) ;. add (ds);
}
. out.println ( Database connection established ) ;. close ();
} (Exception e)
{. err.println ( Can not connect to database server ) ;. printStackTrace ();
} list;
}
//============================================================ArrayListlt;DS_Cargt; selectCars ()
{conn=null; .sql.Statement S; result=null; rs=null; lt; DS_Car gt; list=new ArrayList lt; DS_Car gt; (); _ Car ds;
{. forName ( com.mysql.jdbc.Driver ). newInstance ();=DriverManager.getConnection (DB_HOST, DB_USER, DB_PASSWORD);=conn.createStatement ();
queryStr= call C_Select () raquo ;;=S.executeQuery (queryStr);=result.getMetaData ();
(result.next ())
{= _ds.new DS_Car () ;. number=result.getString ( number ) ;. color=result.getString ( color ) ;. model=result.getString ( model ) ;. fname=result.getString ( FName ) ;. mname=result.getString ( MName ) ;. lname=result.getString ( LName ) ;. numPas=result. getInt ( num_pas ) ;. idCar=result.getInt ( id_car ) ;. add (ds);
}
. out.println ( Database connection established ) ;. close ();
} (Exception e)
{. err.println ( Can not connect to database server ) ;. printStackTrace ();
} list;
}
//============================================================ArrayListlt;DS_Driver_Freegt; getDriversFree ()
{conn=null; .sql.Statement S; result=null; rs=null; lt; DS_Driver_Free gt; list=new ArrayList lt; DS_Driver_Free gt; (); _ Driver_Free ds;
{. forName ( com.mysql.jdbc.Driver Raquo;). NewInstance ();=DriverManager.getConnection (DB_HOST, DB_USER, DB_PASSWORD);=conn.createStatement ();
sql=new StringBuffer () ;. append ( call DRC_get_free (); );=S.executeQuery (sql.toString ());=result.getMetaData ();
(result.next ())
{= _ds.new DS_Driver_Free () ;. idDriver=result.getInt ( id_driver ) ;. number=result.getString ( number ) ;. color=result.getString ( color ) ;. model=result.getString ( model ) ;. fname=result.getString ( FName ) ;. mname=result.getString ( MName ) ;. lname=result. getString ( LName ) ;. numPas=result.getInt ( num_pas ) ;. add (ds);
}
. out.println ( Database connection established ) ;. close ();
} (Exception e)
{. err.println ( Can not connect to database server ) ;. printStackTrace ();
} list;
}
//============================================================ArrayListlt;DS_Driver_Busygt; getDriversBusy ()
{conn=null; .sql.Statement S; result=null; rs=null; lt; DS_Driver_Busy gt; list=new ArrayList lt; DS_Driver_Busy gt; (); _ Driver_Busy ds;
{. forName ( com.mysql.jdbc.Driver ). newInstance ();=DriverManager.getConnection (DB_HOST, DB_USER, DB_PASSWORD);=conn.createStatement ();
sql=new StringBuffer () ;. append ( call DRC_get_busy (); );=S.executeQuery (sql.toString ());=result.getMetaData ();
(result.next ())
{= _ds.new DS_Driver_Busy () ;. idOrder=result.getInt ( id_order ) ;. idDriver=result.getInt ( id_driver ) ;. idClient=result.getInt ( id_client ) ;. dr_lname=result.getString ( D.LName ) ;. dr_fname=result.getString ( D.FName ) ;. dr_mname=result.getString ( D.MName ) ; .cl_lname=result.getString ( CL.LName ) ;. cl_fname=result.getString ( CL.FName ) ;. cl_mname=result.getString ( CL.MName ) ;. addr_from=result.getString ( Addr_From ) ;. addr_to=result.getString ( Addr_Dest ) ;. timeOn=result.getTime ( TimeOn ) ;. add (ds);
}
. out.println ( Database connect...