Package me.axolotldev.dbconnector.driver
Class MySQLDriverData
-
- All Implemented Interfaces:
-
me.axolotldev.dbconnector.abstracts.database.DriverInfo
public final class MySQLDriverData implements DriverInfo
MySQLDriverData represents the MySQL database driver information. It extends the DriverInfo abstract class and provides the necessary details and functions for MySQL database connections.
-
-
Field Summary
Fields Modifier and Type Field Description public final static MySQLDriverData
INSTANCE
private final String
name
private final String
driverAddress
-
Method Summary
Modifier and Type Method Description String
getName()
String
getDriverAddress()
String
generateURI(DatabaseInfo info)
Generates a JDBC connection URI string for MySQL using the given DatabaseInfo. Boolean
isValidURI(String uri)
Checks whether the given JDBC URI is valid and accepted by any loaded JDBC driver. -
-
Method Detail
-
getDriverAddress
String getDriverAddress()
-
generateURI
String generateURI(DatabaseInfo info)
Generates a JDBC connection URI string for MySQL using the given DatabaseInfo.
- Parameters:
info
- the DatabaseInfo object containing host, port, database name, and additional connection options- Returns:
a formatted JDBC URI string in the form of jdbc:mysql://host:port/database?option1=value1&option2=value2
-
isValidURI
Boolean isValidURI(String uri)
Checks whether the given JDBC URI is valid and accepted by any loaded JDBC driver.
- Parameters:
uri
- the JDBC URI string to validate- Returns:
true if any registered driver accepts the URI, false otherwise
-
-
-
-