Package com.jdbc.database
Class DB2024TEAM07_Database
java.lang.Object
com.jdbc.database.DB2024TEAM07_Database
This class provides a single point of access to the database connection for the E-MATEASY application.
It utilizes the Singleton design pattern to ensure only one instance of the database connection is created
and shared throughout the application.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Connection(package private) static final StringThe database URL for connecting to the E-MATEASY database.private static DB2024TEAM07_Database(package private) static final StringThe JDBC driver class name.(package private) static final String(package private) static final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePrivate constructor to prevent object creation from outside the class. -
Method Summary
Modifier and TypeMethodDescriptionProvides access to the established database connection.static DB2024TEAM07_DatabaseReturns the single instance of the DB2024TEAM07_Database object.
-
Field Details
-
JDBC_DRIVER
The JDBC driver class name.- See Also:
-
DB_URL
The database URL for connecting to the E-MATEASY database.- See Also:
-
USER
- See Also:
-
PASS
- See Also:
-
instance
-
conn
-
-
Constructor Details
-
DB2024TEAM07_Database
private DB2024TEAM07_Database()Private constructor to prevent object creation from outside the class. This enforces the Singleton design pattern.
-
-
Method Details
-
getInstance
Returns the single instance of the DB2024TEAM07_Database object.- Returns:
- the instance of DB2024TEAM07_Database
-
getConnection
Provides access to the established database connection.- Returns:
- the Connection object representing the connection to the database
-