tag:blogger.com,1999:blog-15929719.post8665652954963444083..comments2023-10-21T01:56:53.775-07:00Comments on Van Couvering Is Not a Verb: Where are my database tables in NetBeans?Anonymoushttp://www.blogger.com/profile/04898259486137280102noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-15929719.post-72573644851277397892007-10-05T00:34:00.000-07:002007-10-05T00:34:00.000-07:00I'm not so sure that the "best way" solution to th...I'm not so sure that the "best way" solution to the "Two different databases" problem is to use an absolute path.<BR/><BR/>It may be the <I>easiest</I> way during development, but for reasons mentioned by the first anonymous commenter, it is probably <I>not</I> the best way when you are deploying your application, for instance.<BR/><BR/>The best way, I would say, is to make an effort trying to <I>understand</I> these path issues, by reading docs and (above all) experimenting. Then implement the solution that works best for you. This could be using an absolute path, or it could be setting derby.system.home, or something else.<BR/><BR/>My number one tip for avoiding these issues is:<BR/><BR/> <B>Don't include</B> ;create=true <B>in more than <I>one</I> of your connection URLs.</B><BR/><BR/>Actually, include it only the <I>first time</I> you connect to the database, i.e. when you create it. Then remove that attribute from your URL. This way, you will avoid having databases with the same name being created all over the place depending on how many different tools you use. You will get an error message instead, if your URL doesn't point to the actual database.<BR/><BR/>So, if you created your database using ij, but want to browse the data using Netbeans, then <I>don't</I> include ;create=true in the Netbeans URL.<BR/><BR/>Also, my #1 tip for detecting whether or not you have this issue: <BR/><B>Do a file search for the database name.</B> For example, if you have a URL like 'jdbc:derby:mydb', or 'jdbc:derby://localhost:1527/myRelativeDir/mydb', then search for directories called 'mydb'. If you end up with more than one match, you know where to start further investigations...Johnhttps://www.blogger.com/profile/12708805107175630919noreply@blogger.comtag:blogger.com,1999:blog-15929719.post-87013204614963090752007-10-04T23:18:00.000-07:002007-10-04T23:18:00.000-07:00Actually David, I disagree respectfully.Better, AS...Actually David, I disagree respectfully.<BR/><BR/>Better, ASSUMING you are running the NetWork server is NEVER to have the path in the JDBC name, and instead set the derby.system.home property first before starting network server.<BR/><BR/>IMO, it's better to abstract the detail this way.<BR/><BR/>And it avoids some issues on uncommon NOS's like NetWare, where Derby JDBC URL parsing will choke (Netware has paths like SERVER\VOLUME:PATH1\PATH2 ... trust me this will get misinterpreted!)Anonymousnoreply@blogger.com