I have to build a client/server database; the server builds the database that contains a single table. It has to pass the table to
the client which will display it in a
The server retrieves the SQL commands from a txt file.
The question is how do I (Server) pass the table that I've created to the client?
I thought of
ArrayList but it gets really complicated and hard to handle.
The server code:
//Load driver, connect to JDBC..
private void DBSetup()
statement = connection.createStatement();
FileInputStream fstream = new FileInputStream("mysql.txt");
// Get the object of DataInputStream
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
//Read File Line By Line
while ((strLine = br.readLine()) != null)
if (strLine != null && !strLine.equals(""))
}catch (java.lang.Exception ex)
My program supports multiple clients, so I have a hashTable that holds the socket and the outputStream of each client.
P.S.: I'm working with javaFX.