-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSanctionJobUtility.java
More file actions
51 lines (43 loc) · 1.41 KB
/
SanctionJobUtility.java
File metadata and controls
51 lines (43 loc) · 1.41 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
package mnregapkg;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
public class SanctionJobUtility {
public SanctionJobBean pullSanctionBean(int userid) {
// TODO Auto-generated method stub
SanctionJobBean sanctionJobBean = null;
DBManager manager= new DBManager();
Connection localCon= manager.getConnection();
PreparedStatement preSt=null;
ResultSet rs=null;
String query="select name,email,jobname,jobs.jobid from jobs,jobsapplied,user where jobsapplied.userid=? and jobs.jobid=jobsapplied.jobid";
try {
preSt=localCon.prepareStatement(query);
preSt.setInt(1, userid);
System.out.println("in sanctionjobutility");
rs=preSt.executeQuery();
if(rs!=null){
while(rs.next()){
sanctionJobBean = new SanctionJobBean();
sanctionJobBean.setname(rs.getString(1));
sanctionJobBean.setemail(rs.getString(2));
sanctionJobBean.setjobname(rs.getString(3));
sanctionJobBean.setjobid(rs.getInt(4));
}
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return sanctionJobBean;
}
public JobsDataBean makeJobsDataBean(int userid) {
// TODO Auto-generated method stub
DBManager manager = new DBManager();
Connection localCon=manager.getConnection();
String query="";
PreparedStatement preSt=localCon.prepareStatement(query);
return null;
}
}