Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Database not found error  RSS feed

 
Igor Soudakevitch
Author
Ranch Hand
Posts: 38
7
Android Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to set up a remote Derby DB just for practice, and I keep getting the 'Database not found' error.
This is what I did:
- created a DB (named 'derbyDB') on my system and checked its operability; the DB proved to be fully accessible, traversable and updatable;
- uploaded the entire DB folder to the /html_public/ dir on my Hostgator-hosted website www.igor.host;
- tried to access it --- and stuck with this error: "Database 'http://igor.host/derbyDB' not found".

Here's the code I am using to access the DB:



The first try-catch checks if this particular JVM instance is able to communicate with the server at all; the result is encouraging: the specified file is accessible and readable (Line 7).
The second try-catch, however, fails miserably as if the JVM can't see the DB at all. I also tried to use my IP address (the commented out Line 14); same error...

What am I missing?


 
Igor Soudakevitch
Author
Ranch Hand
Posts: 38
7
Android Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fifty minutes later, and it looks like I found the answer to my own question.
This is what the Apache Derby official documentation says ( https://db.apache.org/derby/docs/10.0/manuals/develop/develop14.html ):

You can specify only databases that are local to the machine on which the JVM is running. NFS file systems on UNIX and remote shared files on Windows (//machine/directory) are not guaranteed to work.


Didn't see it coming...    My OCP exam is in two weeks; what a disappointment...
 
Knute Snortum
Sheriff
Posts: 3553
86
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for getting back to us on what you found.  I didn't think you could go over HTTP like that.  But why is that necessary?
 
Igor Soudakevitch
Author
Ranch Hand
Posts: 38
7
Android Java Netbeans IDE
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's just practice for my exam, nothing more. Playing with that DB on my harddisk was too boring, I needed more action, like setting up a DB on the server without using cPanel and so on. Simply put, I just love to get my hands dirty and see how things work
 
Dave Tolls
Ranch Hand
Posts: 2504
27
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can set Derby up as a Network Server, but that's more than simply putting the database on the server in question.
There'll be details in the Derby docs, but you may not be able to do that against a CPanel controlled system.
 
Igor Soudakevitch
Author
Ranch Hand
Posts: 38
7
Android Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Dave, you are completely right. Seeing that I couldn't set up Derby in a snap I decided to play with a MySQL DB instead deploying it via cPanel. Everything is working as it should now so I'm going to have all the practice I'd ever need for the exam.  
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!