Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Function Definition
- public String[] selectPhoneDirectory(String siteId){
- String[] detailofemployee = new String[25];
- openConnection();
- String query = "Select * from Telephone_master with(nolock) where Site_ID = '"+siteId+"' order by User_Name";
- int i =0;
- try{
- rs = st.executeQuery(query);
- while(rs.next()){
- detailofemployee[i] = rs.getString(3)+"~"+rs.getString(4)+"~"+rs.getString(5)+"~"+rs.getString(6)+"~"+rs.getString(7);
- System.out.println("The Detail Is :"+detailofemployee[i]);
- i++;
- }
- }
- catch (Exception e) {
- System.out.println("Error!!!"+e);
- }
- closeConnection();
- return detailofemployee;
- }
- //Calling Function
- for(int i = 0; i < siteName.length; i++){
- if(siteName[i].equalsIgnoreCase(strselectedName)){
- detailEmployee = gd.selectPhoneDirectory(siteId[i]);
- }
- for(int j = 0 ;j < detailEmployee.length ; j++){
- StringTokenizer st =new StringTokenizer(detailEmployee[j]);
- empName[j] = new String();
- empName[j] = st.nextToken("~").toString();
- System.out.println("The Name Is :"+empName[j]);
- empHome[j] = new String();
- empHome[j] = st.nextToken("~").toString();
- System.out.println("The Home No Is :"+empHome[j]);
- empMob[j] = new String();
- empMob[j] = st.nextToken("~").toString();
- System.out.println("The Mobile No Is :"+empMob[j]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement