-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBankServer.java
More file actions
29 lines (24 loc) · 841 Bytes
/
Copy pathBankServer.java
File metadata and controls
29 lines (24 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package bankingsystem;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
public class BankServer {
public static void main(String[] args)
{
try
{
ServerSocket server = new ServerSocket(1234);
DatabaseInterface.Init("jdbc:mysql://127.0.0.1:3306/BankingSystem?autoReconnect=true&useSSL=false", "root", "u1234q-a-z");
while (true) {
Socket clientSocket = server.accept();
System.out.println("Connected with a client!");
ClientHandler_ServerSide ch = new ClientHandler_ServerSide(clientSocket);
ch.start();
}
}
catch(IOException e)
{
System.out.println(e.getMessage() + ": Connection with a client failed!");
}
}
}