Hi! I have been developing and distributing Standalone Java Products in my local market for 4 years. My products include, POS Softwares for Retail and whole Sale Businesses and for Food Businesses such as Restaurants and cafes.
I use Apache Derby Database which is also known as 'JavaDB' as database and it works perfectly. I have also used JavaDB in a Cient Server Architecture (e.g if my customer has 3 PCs, and he wants to centralized database on his one Physical Server).

For database in Local Machine I used following Connections Strings:

    String dbdriver = "org.apache.derby.jdbc.EmbeddedDriver";
  Class.forName(dbdriver).newInstance();
 con = DriverManager.getConnection("jdbc:derby:C:\\QuintexDB; create = true"); 

And for Remote Servers is Used following Connection Strings:

 con = DriverManager.getConnection("jdbc:derby://192.168.10.125/C:\\QuintexDB; create = true"); 

As you saw that In Case of Remote server I used IP address of that machine. Firstly I gave static IP address to all PCs and server
and then Start the JavaDBServer by running CMD commands on Server Machine. And its works perfectly.

Now I need a new thing , I want JavaDB on cloud. What I want is I set up an account on Cloud service which provide facility of JavaDB and In My Connection String I just put the web address or IP address of that cloud services which is linked to my Account.
And When Me or my Customer starts his/ her java Destktop based application on his PC, the Java application should connect to the JavaDB on that cloud service and do his/her work. In short Now i am going to make my product an ERP.

I am facing two problems here:
1-) I searched on google by following phrases: "Online JavaDB connectivity" OR "Connect java application to online JavaDB" etc.
But most of the websites google provided me were providing only Mysql Database services
2-) And i also could not find , that what the connection string should be in this case in my Code. Because I have also worked many times with mySQL in my local machine and I know very well the connection string for that.

I need your help in finding me the the Hosting Service website which provides JavaDB and also guide me What should be the connection String to connect with that Cloud based JavaDB.

Dani AI

Generated

already had a working local/client-server setup; moving that to the cloud has three practical options: (1) run the Derby Network Server on a cloud VM and let desktop clients talk to it, (2) host Derby inside Tomcat (or TomEE) and expose a pooled JNDI DataSource to an app layer, or (3) avoid direct DB exposure and put a small REST/HTTPS service between the desktop clients and the database (best for security and scaling). 's Tomcat idea is valid; Tomcat provides standard DataSource support for this pattern. (tomcat.apache.org)

For a quick IaaS VM workflow: provision a VM, install a JDK, place the Derby distribution on the server and set its system directory, then start the Derby Network Server (note: it listens on localhost by default, so explicitly bind it and pick a port if needed). Example commands and the client JDBC URL pattern look like this:

# start on server (example)
java org.apache.derby.drda.NetworkServerControl start -h 0.0.0.0 -p 1527

# client JDBC pattern
jdbc:derby://db.example.com:1527/MyDatabase;create=true;user=app;password=secret

Also ensure firewall/security groups only allow trusted IPs to reach the DB port. (db.apache.org)

Security and hardening notes: do not expose a DB port to the open internet. Prefer a VPN, an SSH tunnel, or a REST API layer. If using the Network Server, enable Derby authentication and limit file access via derby.system.home. Example minimal properties (place in the server's derby.properties or set at startup):

derby.connection.requireAuthentication=true
derby.authentication.provider=BUILTIN
derby.user.admin=StrongPasswordHere
derby.database.fullAccessUsers=admin

Read and apply the security properties before allowing remote binds. (db.apache.org)

Troubleshooting and practical tips: the client needs the Derby network client jar (derbyclient.jar) and the client driver; keep client and server Derby versions aligned; prefer relative DB names on the server (set derby.system.home) rather than embedding full Windows paths in client URLs. If stability, backups, HA and easy management are priorities for an ERP, consider putting a proper application server or a managed SQL service in front of or instead of a raw DB port. (db.apache.org)

Recommended Answers

All 3 Replies

A few issues.

  1. JavaDB doesn't appear to be distributed any longer. I'm reading which was in 2015 so I'll write JavaDB is no more.

  2. https://db.apache.org/derby/docs/10.0/manuals/admin/hubprnt09.html gives us a clue that we may want to search for hosting for Tomcat. Such should be able to run Derby as well.

  3. If I search for "Tomcat on the cloud" I find various offerings.

JavaDB is just Derby, which moved from Oracle to Apache where it is still very much alive.
The most recent release was March 1st 2021 (!)
https://db.apache.org/derby/

Thanks for all your guidance. I have successfully connected my java application to MySql instead of Derby. Because mysql is comparatively easily available online.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.