This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
My shared server has a prefix to database names in the format of: domainname_com_-_databasename exactly in this format. When I create/use a .java file and compile it to a .class file, the test environment on my standalone computer at home is just the "databasename". Should I be using just this databasename or should I include the entire prefix including underscores and hyphen when I compile? The next step of course would be to upload it to the appropriate directory and attempt to run it. I am using JSP, Java, and the MySQL database that comes on the shared server. ddave
Since the database name is different in your environments, you can store the database name in a property file. (a file with name/value pairs) Your program can read the database name in at runtime. That way, you can used the same .class file and just change the database name when you go to the shared server or standalone environment.