Close old connections
parent
89d4aec6e0
commit
4e47f10f54
|
@ -56,6 +56,13 @@ public class Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void connect(ActionEvent actionEvent) {
|
public void connect(ActionEvent actionEvent) {
|
||||||
|
if (c != null) {
|
||||||
|
try {
|
||||||
|
c.close();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
String url = "jdbc:mysql://" + connect_host.getText() + ":" + connect_port.getText() + "/" + connect_database.getText();
|
String url = "jdbc:mysql://" + connect_host.getText() + ":" + connect_port.getText() + "/" + connect_database.getText();
|
||||||
c = DriverManager.getConnection(url, connect_user.getText(), connect_pass.getText());
|
c = DriverManager.getConnection(url, connect_user.getText(), connect_pass.getText());
|
||||||
|
|
Loading…
Reference in New Issue