I've made a desktop based shop-management software using java that will save every product detail and sell history of a particular shop in a database over internet (phpmyadmin). I've a made a connector class and give the path of the database name which connects to the database. The problem is, for every distinct shop I need to create a different database. If i make a .exe file or installation file of my software and distribute it to users, how am i going to create different databases for each user (in this case each shop) through installation process. Is there any way of doing this dynamically or I have to create the database every time before distributing it to a new user (for a new shop actually) ?
Thanks in advance, I never make a software to distribute commercially. This is new to me.
Note 1: let me explain more about my problem, first take a look of my connector class
public class ispConnect {
static Connection connection;
public static Connection connecterDb(){
try{
Class.forName("com.mysql.jdbc.Driver");
connection = DriverManager.getConnection("jdbc:mysql://ServeName/DatabaseName","root","");
System.out.println("Connection Established!");
return connection;
}catch(Exception e){
System.out.print("Connection Failed!");
return null;
}
}
this the connector class which connects with the database "DatabaseName". Now if I make a installer file I can't change the "DatabaseName". Let assume I have two customer X, Y the both need my application. for both of them i need to create two database name- let DatabaseName1 for X and DatabaseName2 for Y other-wise both of their data will save into the same database - "DatabaseName" . Now my question is do i have to change database name manually for each customer every time and then make a installer again before delivering my application to them or there is other option to do it !