title: networking javaSE applications
body: <p>This is my db class for my JavaSE application. </p>
  
  <pre><code>public class db {
      static Connection c;
      public static Connection Get_Connection() throws ClassNotFoundException,SQLException {
          if (c == null) {
              String ip = "";
              String port = "";
              String username = "";
              String password = "";
              try {
                  BufferedReader br = new BufferedReader(new FileReader(System.getProperty("user.home") + "/ConnectionSettings.txt"));   
                  ip = br.readLine();
                  port = br.readLine();
                  username = br.readLine();
                  password = br.readLine();
                  br.close();
              } catch (Exception e) {
                  e.printStackTrace();
              }
              Class.forName("com.mysql.jdbc.Driver");
              c = DriverManager.getConnection("jdbc:mysql://" + ip + ":"+port + "/mydb", username, password);
          }
          return c;
      }
  </code></pre>
  
  <p>I know this isn't a good practice. I'm getting IP address, database password and port from a text file saved in <code>C:/..</code>.</p>
  
  <p>My question is, if I want to network the project is it okay to provide IP address of server machine in this db class?</p>
  
  <p>If not tell me why, and how to network JavaSE applications?</p>
  
  <p>It's okay if you provide answers in links.</p>
  
  <p>What are the frameworks I should be using to network the applications?</p>
  
  <p>Will <code>hibernate</code> be a solution for this?</p>