title: Declaring a static constant in Java will affect the compiled class
body: <p>Ok here's my doubt...</p>
  
  <p>I have a blazeDS (tomcat) application with some classes, each Class use the <code>Config</code> and <code>DB</code> Class for configuration and DB connection...</p>
  
  <p>Here's an example of </p>
  
  <p><code>Config</code>Class</p>
  
  <pre><code>public class Config {
      public static final String DBClass = "oracle.jdbc.driver.OracleDriver";
      public static final String ConnectString = "jdbc:oracle:thin:@//127.0.0.1:1521/xe";
      public static final String UserDB = "user";
      public static final String PasswordDB = "pass"; 
  }
  </code></pre>
  
  <p><code>DB</code> Class</p>
  
  <pre><code>public class DB
  {       
      public DB() {}
  
      public static Connection dbConnect(Connection c)
      {
                  try
                  {      if (c == null || c.isClosed()){                                  
                              Class.forName(Config.DBClass);
                              c = DriverManager.getConnection(Config.ConnectString,Config.UserDB,Config.PasswordDB);
                          }
                  return c;                        
                  }
                  catch (Exception e)
                  {
                          System.out.println(e.getMessage());
                          return null;
                  }
      }
  
      public static void closeConnection(Connection connection) throws SQLException
      {
          if (!connection.isClosed())
              connection.close();
      }
  }
  </code></pre>
  
  <p>I have a test and production environment, with different user/password per DB access..
  I noticed that when updating the production file with the test classes (I do not overwrite the <code>Config.class</code>), I got error from DB...</p>
  
  <p>So, are the <code>static final</code> values (user/pass) in compiled version saved directly in the class itself (in my case DB.class)???</p>