Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Underscore and Hyphens in DB Name on Shared Server

 
Dolfandave Uyemura
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34422
347
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Dolfandave Uyemura
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok,
So what are the steps necessary to create and upload this file?
ddave
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34422
347
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The file is just a plain text file:

You upload the file the same way you upload your .java or .class file. Just put it in the same directory.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic