1 2 3 Previous Next 33 Replies Latest reply on Mar 10, 2013 3:34 AM by EJP Go to original post
      • 30. Re: Hash Mapping
        These Doctors record are coming from user input in textfield which you are reading in your application?
        • 31. Re: Hash Mapping
          They are Coming from a Database Connection,

          public class DBUtil 
                  private static final String USERNAME = "dbuser"; // USERNAME on the Database
                  private static final String PASSWORD = "dbpassword"; // PASSWORD FOR the  Database 
                  private static final String M_CONN_STRING = 
                         "jdbc:mysql://localhost/Doctor"; // Database Name & Location
                   *  This Section below is a Switch Case, If needed we can allow the User 
                   *  To Either Use MYSQL or HSQL by adding a another Case with a Return 
                   *  of the DriverManger.getConnection. 
                   * @param dbType
                   * @return
                   * @throws SQLException
               public static Connection getConnection(DBType dbType) throws SQLException
                    switch (dbType) //Calls the dbType Enum Class
                    case MYSQL: // My MySQL
                         return DriverManager.getConnection(M_CONN_STRING, USERNAME, PASSWORD); //Return the URL, Username & Password
                    return null; 
                    }// End Switch
               }//End static Connection 
               // Catch SQL Exception 
               public static void processException(SQLException e)
                    System.err.println("Error message:" + e.getMessage()); // Give Error message 
                    System.err.println("Error Code: " + e.getErrorCode()); // Give the SQL Error Code
                    System.err.println("SQL State: " + e.getSQLState()); // Shows Which SQL State has the Error
               } // End public static void processException
          } // End Public Class DBUtil
          • 32. Re: Hash Mapping
            ok.. So the values are being read from database and then Where are they SET to textfields?
            • 33. Re: Hash Mapping
              Moderator action: Locking this futile thread.
              1 2 3 Previous Next