mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUACAMOLE-1407: Automatically detect whether MySQL or MariaDB version of "Connector/J" is installed.
This commit is contained in:
@@ -192,4 +192,24 @@ public abstract class JDBCEnvironment extends DelegatingEnvironment {
|
||||
*/
|
||||
public abstract String getPassword() throws GuacamoleException;
|
||||
|
||||
/**
|
||||
* Returns whether the given Java class is defined within the classpath.
|
||||
*
|
||||
* @param classname
|
||||
* The name of the Java class to check.
|
||||
*
|
||||
* @return
|
||||
* true if the given Java class is present within the classpath, false
|
||||
* otherwise.
|
||||
*/
|
||||
public static boolean isClassDefined(String classname) {
|
||||
try {
|
||||
Class.forName(classname, false, JDBCEnvironment.class.getClassLoader());
|
||||
return true;
|
||||
}
|
||||
catch (ClassNotFoundException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user