-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserService.java
More file actions
55 lines (41 loc) · 1.18 KB
/
UserService.java
File metadata and controls
55 lines (41 loc) · 1.18 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package Hospital;
import java.sql.Connection;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.text.SimpleDateFormat;
import java.util.Scanner;
public class UserService {
boolean status;
PreparedStatement pst;
ResultSet rs;
Scanner sc = new Scanner(System.in);
public void viewProfile(String id){
Connection conn;
try {
conn = ConnectionProvider.provideConnection();
pst =conn.prepareStatement("select * from login where Id=?");
pst.setString(1, id);
rs=pst.executeQuery();
while(rs.next())
{
System.out.println(rs.getString(1));
}
}
catch(Exception e){}
// System.out.println("See Profile");
}
public void getAppointment(){
System.out.println("Enter id:");
int id1=sc.nextInt();
System.out.println("Enter name:");
String nm=sc.next();
Date dNow = new Date(0);
SimpleDateFormat ft =
new SimpleDateFormat ("E yyyy.MM.dd 'at' hh:mm:ss a zzz");
System.out.println("Current Date: " + ft.format(dNow));
}
public void checkAppointmentStatus(){
System.out.println("Appointment Status Checked");
}
}