You really have two options with Oracle 11g and an alternative to Oracle 11g.
The first is to use your PC or some other PC as a database host and have any other instance of your application reference your databases on that database host. This may require a change in the JDBC connection to specify where the host is and there are some other issues that may need to be addressed depending on your environment. See below for a brief discussion.
The second is to replicate the database on each PC that will be running your application. This will require installation Oracle 11g on each PC and then replicating the database on your PC to the other PC. See What is the easiest way to transfer Oracle database from one PC to another?
A third option is to change the database engine to something such as SQLite which uses one or more files allowing for easy replication. Take a look at some of the answers for Java and SQLite.
Concerning the first option with Oracle 11g of sharing a database, there are some runtime environmental issues you will need to consider.
You will need some way of being able to specify the JDBC connection to the PC or server running the database. This gets into directory lookup for PCs and whether your environment has fixed IP addresses or not as well as how mobile are the devices using your application. Firewalls can block connections as well.
After looking at your connect string logic, if you are going to host the database on a particular PC you will need the hostname of the PC or you will need the IP address of the PC (see Java JDBC - How to connect to Oracle using Service Name instead of SID which provides some examples of connect strings and their formats).
In your connect string the server name of localhost
is the PC on which your application is running. So if you move your application with that connect string then running the application on the PC to which it was moved will have the application looking on that PC for the Oracle 11g database engine and the database.
So you need to change localhost
to either the host name of your PC with the Oracle 11g database or you will need to change localhost
to the IP address of the PC running the database.
It also looks like you need to add //
to the beginning of the host name.