ent ();
//======================================== ========================= queryStr= call U_LogIn(raquo;+laquo;laquo;raquo;+ulog+laquo;raquo;raquo;+laquo;,raquo;+laquo;laquo;raquo;+upass+laquo;raquo;raquo;+laquo;)raquo;;result =S.executeQuery (queryStr); rs=result.getMetaData ();
(result.next ()) {= result.getInt ( level );
};
//=================================================================.out.println(laquo;Database connection established ) ;. close ();
} (Exception e)
{. err.println ( Can not connect to database server ) ;. printStackTrace ();
}
resFunc;
} ArrayList lt; DS_User gt; getUserByPassword (String logn, String pass)
{conn=null; .sql.Statement S; result=null; rs=null; lt; DS_User gt; list=new ArrayList lt; DS_User gt; (); _ User ds;
{. forName ( com.mysql.jdbc.Driver ). newInstance ();=DriverManager.getConnection (DB_HOST, DB_USER, DB_PASSWORD);=conn.createStatement ();
sql=new StringBuffer () ;. append ( call U_SelectByInfo(raquo;);.append(laquo;laquo;raquo;);.append(logn);.append(laquo;raquo;raquo;);.append(laquo;,raquo;);.append(laquo;laquo;raquo;);.append(pass);.append(laquo;raquo;raquo;);.append(laquo;);raquo;);= S.executeQuery (sql.toString ());=result.getMetaData ();
(result.next ())
{= _ds.new DS_User () ;. fname=result.getString ( FName ) ;. mname=result.getString ( MName ) ;. lname=result.getString ( LName ) ;. login=logn; .password=pass; .level=result.getInt ( level ) ;. idUser=result.getInt ( id_user ) ;. add (ds);
}
. out.println ( Database connection established ) ;. close ();
} (Exception e)
{. err.println ( Can not connect to database server ) ;. printStackTrace ();
} list;
}
//===================== boolean DeleteOrder (int IDOrder)
{conn=null; .sql.Statement S=null; result=null; rs=null; resQuery=false;
sql=new StringBuffer () ;. append ( call O_Del () ;. append (IDOrder) ;. append (); );
{. forName ( com.mysql.jdbc.Driver ). newInstance ();=DriverManager.getConnection (DB_HOST, DB_USER, DB_PASSWORD);=conn.createStatement ();
. out.println (sql);=S.executeQuery (sql.toString ());=result.getMetaData ();
. out.println ( Database connection established ) ;. close ();=true;
} catch (Exception e)
{. err.println ( Error in order Del ) ;. printStackTrace ();=false;
} resQuery;
}
//============================================================ArrayListlt;DS_Ordergt; selectOrders ()
{conn=null; .sql.Statement S; result=null; rs=null;
lt; DS_Order gt; list=new ArrayList lt; DS_Order gt; (); _ Order ds;
{. forName ( com.mysql.jdbc.Driver ). newInstance ();=DriverManager.getConnection (DB_HOST, DB_USER, DB_PASSWORD);=conn.createStatement ();
queryStr= call O_Select () raquo ;;=S.executeQuery (queryStr);=result.getMetaData ();
(result.next ())
{= _ds.new DS_Order () ;. addrDest=result.getString ( Addr_Dest ) ;. addrFrom=result.getString ( Addr_From ) ;. comment=result.getString ( comment ) ;. dateOff=result.getDate ( TimeOff ) ;. timeOff=result.getTime ( TimeOff ) ;. dateOn=result.getDate ( TimeOn ) ;. timeOn=result. getTime ( TimeOn ) ;. idClient=result.getInt ( id_client ) ;. idDriver=result.getInt ( id_driver ) ;. idUser=result.getInt ( id_user ) ;. length= result.getInt ( length ) ;. price=result.getInt ( price ) ;. idorder=result.getInt ( id_order ) ;. add (ds);
}
. out.println ( Database connection established ) ;. close ();
} (Exception e)
{. err.println ( Can not connect to database server ) ;. printStackTrace ();
} list;
}
//======================================== ==================== void setOffline ()
{conn=null; .sql.Statement S; result=null; rs=null;
{. forName ( com.mysql.jdbc.Driver ). newInstance ();=DriverManager.getConnection (DB_HOST, DB_USER, DB_PASSWORD);=conn.createStatement ();
queryStr= call DR_SetOffLine () raquo ;;=S.execu...