Пример #1
0
 private void PopulateStudentProfilePage(String studentNo) throws Exception {
   try (IDatabaseConnection connection = DatabaseConnectionService.createDatabaseConnection()) {
     try (IStatementExecutor stmtExecutor =
         DatabaseConnectionService.createStatementExecutor(connection)) {
       String student = String.format("SELECT * FROM Students WHERE studentNo ='%s' ", studentNo);
       try (IQueryResultSet resultSet = stmtExecutor.executeQuery(student)) {
         resultSet.moveToFirstRow();
         SetRowValuesToTextboxControls(resultSet);
       }
     }
   }
 }
Пример #2
0
 private void SetRowValuesToTextboxControls(final IQueryResultSet resultSet) {
   studentNoTextBox.setText(resultSet.getString("studentNo"));
   firstNameTextBox.setText(resultSet.getString("firstName"));
   lastNameTextBox.setText(resultSet.getString("lastName"));
   dobTextBox.setText(resultSet.getString("dob"));
   homePhoneTextBox.setText(resultSet.getString("homePhone"));
   workPhoneTextBox.setText(resultSet.getString("workPhone"));
   sexTextBox.setText(resultSet.getString("sex"));
   nationalityTextBox.setText(resultSet.getString("nationality"));
   deptIdTextBox.setText(resultSet.getString("deptId"));
   streetTextBox.setText(resultSet.getString("street"));
   cityTextBox.setText(resultSet.getString("city"));
   pincodeTextBox.setText(resultSet.getString("pincode"));
   classificationTextField.setText(resultSet.getString("STUDENTCLASSIFICATION"));
   degreeTextField.setText(resultSet.getString("DEGREEPROGRAM"));
   yearTextField.setText(resultSet.getString("STUDENTPROGRAM"));
 }