This discussion is archived
1 2 3 Previous Next 33 Replies Latest reply: Mar 9, 2013 7:34 PM by EJP Go to original post RSS
  • 30. Re: Hash Mapping
    893253 Explorer
    Currently Being Moderated
    These Doctors record are coming from user input in textfield which you are reading in your application?
  • 31. Re: Hash Mapping
    995566 Newbie
    Currently Being Moderated
    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
                                  
              default:
              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
    893253 Explorer
    Currently Being Moderated
    ok.. So the values are being read from database and then Where are they SET to textfields?
  • 33. Re: Hash Mapping
    EJP Guru
    Currently Being Moderated
    Moderator action: Locking this futile thread.
1 2 3 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points