diff --git a/src/examples/java/LoginExample.java b/src/examples/java/LoginExample.java index 930bb18..e8051a4 100644 --- a/src/examples/java/LoginExample.java +++ b/src/examples/java/LoginExample.java @@ -1,7 +1,4 @@ import de.gnmyt.sqltoolkit.drivers.MySQLConnection; -import de.gnmyt.sqltoolkit.types.LoginParam; - -import java.util.Arrays; public class LoginExample { @@ -14,19 +11,16 @@ public class LoginExample { String database = "database"; // Then we need to create a connection - MySQLConnection connection = new MySQLConnection(hostname, username, password, database, // Here you need to provide your mysql server data - LoginParam.AUTO_RECONNECT); // You can set login parameters in the constructor + MySQLConnection connection = new MySQLConnection(hostname, username, password, database); // Here you need to provide your mysql server data + + // You can now set the settings of the connection (before connecting) + connection.updateSettings() + .useSSL(true) // You can set for example the ssl property + .customProperty("example", ""); // You can also set a custom property - // You can also set the connection string manually (before connecting) - connection.updateConnectionString(LoginParam.AUTO_RECONNECT, - LoginParam.USE_SSL, - LoginParam.UTF8_ENCODING); // Now you can connect to the database connection.connect(); - - // If you want to you can list all login parameters - Arrays.stream(LoginParam.values()).forEach(System.out::println); } }