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

Public Member Functions

ResultSet getStationByName (String stationName)
 
- 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)
 
java.sql.ResultSet getStationByName (String stationName)
 

Static Public Member Functions

static synchronized StationController 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

The StationController class is responsible for handling operations related to stations, including fetching station details from the database. It implements the StationDAO interface.

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

Example usage:

StationController controller = StationController.getInstance();
ResultSet rs = controller.getStationByName("StationName");
See also
model.StationDAO
model.DatabaseConnector
java.sql.ResultSet
java.sql.SQLException
java.util.logging.Logger
java.util.logging.Level
Author
Muhammad Rizal Anditama Nugraha

Member Function Documentation

◆ getInstance()

static synchronized StationController controller.StationController.getInstance ( )
inlinestatic

Returns the singleton instance of the StationController class. If the instance is null, it creates a new one using the DatabaseConnector instance.

Returns
the singleton instance of StationController.

Reimplemented from controller.Controller.

◆ getStationByName()

ResultSet controller.StationController.getStationByName ( String  stationName)
inline

Retrieves a station by its name from the database.

Parameters
stationNamethe name of the station to retrieve.
Returns
a ResultSet containing the station details, or null if no station with the specified name is found or an error occurs.

Implements model.StationDAO.


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