I am trying to make a video rental store application. I want it to have a client that uses gui and a server which will have the mysql database. The client will connect to the server and based on thier input, contacts the server instructing it to execute the needed sql commands and statements to the database. Then the server returns the results to the client where it will be displayed within the gui to the user. How do you get a client/server connection to work with a mysql database.
MySQL Database Socket Connection
Page 1 of 14 Replies - 4724 Views - Last Post: 13 April 2011 - 08:25 PM
Replies To: MySQL Database Socket Connection
#2
Re: MySQL Database Socket Connection
Posted 13 April 2011 - 10:55 AM
On this forum you can find thread about how you get a connection with database http://www.dreaminco...bc-odbc-bridge/
#3
Re: MySQL Database Socket Connection
Posted 13 April 2011 - 11:02 AM
Thanks. I understand how to connect to a database. But how do you use sockets in correlation to the database?
#4
Re: MySQL Database Socket Connection
Posted 13 April 2011 - 12:34 PM
The Server (which will run on the actual "Server") will have the connection to the (seen from the Server) local MySQL Database (see mi14chal's link). The Client will then use a Socket to connect to the Server.
Sending requests (with a Syntax you'll need to define) from the Client and sending back the results will be done over the In- and OutputStream form the Socket-Connection.
Greetings: Luke
Sending requests (with a Syntax you'll need to define) from the Client and sending back the results will be done over the In- and OutputStream form the Socket-Connection.
Greetings: Luke
#5
Re: MySQL Database Socket Connection
Posted 13 April 2011 - 08:25 PM
Only the Server will be connected to the database. Could be a local database or a remote one accessed by socket connection. And you know how to do that part.
Now you just have to establish a simple Server/Client connection using sockets.
The Client does not have to know (and actually shouldn't know) if the Server:
- has all data in memory (array or ArrayList)
- read data from a text files
- use Oracle, MySql, HSqlDB, ...
If one day you decide to change the way the Server access/store the data, you shouldn't have to make any change to the Client code
Now you just have to establish a simple Server/Client connection using sockets.
The Client does not have to know (and actually shouldn't know) if the Server:
- has all data in memory (array or ArrayList)
- read data from a text files
- use Oracle, MySql, HSqlDB, ...
If one day you decide to change the way the Server access/store the data, you shouldn't have to make any change to the Client code
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|