this.con = connectToDB();
if (con != null ){
String query = ""
Statement statement = this.con.createStatement();
ResultSet resultSet = statement.executeQuery(query);
searchResult = new Vector();
int i = 0;
if (resultSet != null) {
while (resultSet.next()) {
System.out.println("i"+i+1);
String[] name = resultSet.getString("NAME").split(",");
Faculty facutlty = new Faculty(
resultSet.getString("PERSON_UID"),
name[1]+" "+name[0],
resultSet.getString("GOBTPAC_LDAP_USER"),
resultSet.getString("SYRREIN_INTEREST"));
searchResult.add(facutlty);
}
}
statement.close();
resultSet.close();
closeConnection(con);
}
return searchResult;
} catch (SQLException sqlException) {
this.logger.logLines(this.formatter.format(this.today) + ":searchFacultyInterest:Failed");
this.logger.logLines(this.formatter.format(this.today) + ":SQLException:" + sqlException.getMessage());
closeConnection(this.con);
return null;
} catch (NullPointerException nullPointerException) {
this.logger.logLines(this.formatter.format(this.today) + ":searchFacultyInterest:Failed");
this.logger.logLines(this.formatter.format(this.today) + ":NullPointerException:" + nullPointerException.getMessage());
closeConnection(this.con);
return null;
}
|