java - How to make available Oracle 11g database on one PC to another PC -


i have created java eclipse app database tables oracle 11g. works fine in local pc. how can make these tables work pc? maybe have put them in application folder? app connected db via jdbc connector.

the connection logic follows:

try {     class.forname("oracle.jdbc.driver.oracledriver"); } catch (classnotfoundexception e) {     system.out.println("unable load driver class!"); } string url = "jdbc:oracle:thin:@localhost:1521:xe"; string user = "system"; string password = "xxxxpw"; connection connection = null; try {     connection = drivermanager.getconnection(url, user, password);     system.out.println("connection succeed!!"); } catch (sqlexception e) {     system.out.println("couldn't take connection!"); }  

you have 2 options oracle 11g , alternative oracle 11g.

the first use pc or other pc database host , have other instance of application reference databases on database host. may require change in jdbc connection specify host , there other issues may need addressed depending on environment. see below brief discussion.

the second replicate database on each pc running application. require installation oracle 11g on each pc , replicating database on pc other pc. see what easiest way transfer oracle database 1 pc another?

a third option change database engine such sqlite uses 1 or more files allowing easy replication. take @ of answers java , sqlite.

concerning first option oracle 11g of sharing database, there runtime environmental issues need consider.

you need way of being able specify jdbc connection pc or server running database. gets directory lookup pcs , whether environment has fixed ip addresses or not how mobile devices using application. firewalls can block connections well.

after looking @ connect string logic, if going host database on particular pc need hostname of pc or need ip address of pc (see java jdbc - how connect oracle using service name instead of sid provides examples of connect strings , formats).

in connect string server name of localhost pc on application running. if move application connect string running application on pc moved have application looking on pc oracle 11g database engine , database.

so need change localhost either host name of pc oracle 11g database or need change localhost ip address of pc running database.

it looks need add // beginning of host name.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -