Kereta Yarsi Indonesia
Loading...
Searching...
No Matches
controller.TrainController Class Reference
Inheritance diagram for controller.TrainController:
controller.Controller model.TrainDAO

Public Member Functions

Train getTrainByTrainName (String trainName)
 
- Public Member Functions inherited from controller.Controller
void setFirstStuff (String stasiunAsal, String stasiunAkhir, Date tanggalPergi, Date tanggalPulang)
 
int countFoundTrain (String stasiunAwal, String stasiunAkhir, Date tanggal)
 
ResultSet findSpecificTrain (String stasiunAwal, String stasiunAkhir, Date tanggal)
 
ResultSet findAll (String table)
 
ResultSet findWhere (String table, String columnName, Object keyword)
 
ResultSet executeQuery (String sql)
 
ResultSet executeQuery (String sql, Object... values)
 
boolean executeUpdate (String sql, Object... values)
 
boolean insert (String table, boolean withID, Object... value)
 
void errorMessage (String title, String message) throws HeadlessException
 
void warningMessage (String message) throws HeadlessException
 
void infoMessage (String message) throws HeadlessException
 
String[] getColumnName (String table)
 
int getColumnCount (String table)
 
int getRowCount (String table)
 
boolean checkForDatabase (String database) throws SQLException
 
int getRowCountWhere (String table, String columnName, String keyword)
 
boolean hasWhitespace (String str)
 
boolean hasSpecialChar (String str)
 
boolean hasUpperCase (String str)
 
byte[] generateKey (int keyLength)
 
String hashPassword (String str)
 
Train getTrainByTrainName (String trainName)
 

Static Public Member Functions

static synchronized TrainController getInstance ()
 
- Static Public Member Functions inherited from controller.Controller
static synchronized Controller getInstance ()
 
static synchronized Session getSession ()
 
static byte[] generateSalt (int saltIteration)
 
static String encryptPBKDF2 (String password, byte[] salt)
 
static boolean verifyPassword (String inputPassword, String storedPassword, byte[] salt)
 
static DefaultTableModel buildTableModel (ResultSet rs) throws SQLException
 
static Statement getSt ()
 
static void setSt (Statement aSt)
 
static ResultSet getRs ()
 
static void setRs (ResultSet aRs)
 
static PreparedStatement getPs ()
 
static void setPs (PreparedStatement aPs)
 

Additional Inherited Members

- Public Attributes inherited from controller.Controller
boolean response = false
 
Session session = Session.getInstance()
 
- Static Public Attributes inherited from controller.Controller
static Statement st
 
static ResultSet rs
 
static PreparedStatement ps
 
- Protected Member Functions inherited from controller.Controller
 Controller (DatabaseConnector databaseConnector)
 
- Static Protected Attributes inherited from controller.Controller
static DatabaseConnector databaseConnector
 
static Connection con
 
static String sql
 

Detailed Description

Controller class for handling operations related to trains. Implements the TrainDAO interface to provide data access methods for trains.

This class uses the singleton pattern to ensure that only one instance of the controller exists.

Example usage:

TrainController controller = TrainController.getInstance();
Train train = controller.getTrainByTrainName("Argo Bromo");
See also
model.TrainDAO
model.Train
model.DatabaseConnector
Version
1.0
Author
Muhammad Rizal Anditama Nugraha

Member Function Documentation

◆ getInstance()

static synchronized TrainController controller.TrainController.getInstance ( )
inlinestatic

Returns the single instance of TrainController. If no instance exists, it creates one using the provided DatabaseConnector.

Returns
the singleton instance of TrainController

Reimplemented from controller.Controller.

◆ getTrainByTrainName()

Train controller.TrainController.getTrainByTrainName ( String  trainName)
inline

Retrieves a train from the database by its name.

Parameters
trainNamethe name of the train to retrieve
Returns
a Train object if found, otherwise null

Implements model.TrainDAO.


The documentation for this class was generated from the following file: