Underscore and Hyphens in DB Name on Shared Server
Joined: Jun 11, 2002
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.