logintodb nonstatic
This commit is contained in:
parent
30b51f9032
commit
26279130b7
@ -70,7 +70,7 @@ public class JDBC {
|
|||||||
*/
|
*/
|
||||||
public static JDBC getInstance() {
|
public static JDBC getInstance() {
|
||||||
if (!loggedin) {
|
if (!loggedin) {
|
||||||
logintodb(usernamec, passwordc, dbnamec, ipc, portc);
|
JDBC = new JDBC(usernamec, passwordc, dbnamec, ipc, portc);
|
||||||
}
|
}
|
||||||
return JDBC;
|
return JDBC;
|
||||||
}
|
}
|
||||||
@ -85,7 +85,7 @@ public class JDBC {
|
|||||||
* @param port Server port
|
* @param port Server port
|
||||||
* @throws IOException thrown if no connection to db is possible.
|
* @throws IOException thrown if no connection to db is possible.
|
||||||
*/
|
*/
|
||||||
private static boolean logintodb(String username, String password, String dbname, String ip, int port) {
|
private boolean logintodb(String username, String password, String dbname, String ip, int port) {
|
||||||
try {
|
try {
|
||||||
DriverManager.setLoginTimeout(1);
|
DriverManager.setLoginTimeout(1);
|
||||||
conn = DriverManager.getConnection(
|
conn = DriverManager.getConnection(
|
||||||
|
Loading…
Reference in New Issue
Block a user