Skip to content

Commit 1ff3f77

Browse files
committed
Create QueryServer
This program is continuously waiting for requests from clients. Once the server receives a request, it will create a thread to process the request and send a response to the client. It means that the server follows the thread per request multi threading model. The server maintains student's contact details in a table in a database. Each time the server receives a request, it will query the table for the corresponding student's contact details.
1 parent de721ca commit 1ff3f77

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

QueryServer

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* To change this template, choose Tools | Templates
3+
* and open the template in the editor.
4+
*/
5+
6+
7+
import java.net.*;
8+
import java.io.*;
9+
import java.sql.*;
10+
11+
12+
13+
14+
/**
15+
*
16+
* @author Reza Nourbakhsh
17+
*/
18+
public class StudentServer {
19+
20+
public static void main(String args[]) throws Exception
21+
{
22+
23+
Thread t1 = new Thread() {
24+
public void run() {
25+
Contact Con = new Contact();
26+
Con.ServerProcess();
27+
}
28+
};
29+
30+
t1.start();
31+
32+
}
33+
}
34+
35+
36+
37+
38+
39+

0 commit comments

Comments
 (0)