Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

database not found

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Exception in thread "main" java.sql.SQLNonTransientConnectionException: The connection was refused because the database test was not found.
at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source)
at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
at org.apache.derby.jdbc.ClientDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:579)
at java.sql.DriverManager.getConnection(DriverManager.java:243)
at Student.main(Student.java:20)
Caused by: org.apache.derby.client.am.DisconnectException: The connection was refused because the database test was not found.
at org.apache.derby.client.net.NetConnectionReply.parseRDBNFNRM(Unknown Source)
at org.apache.derby.client.net.NetConnectionReply.parseAccessRdbError(Unknown Source)
at org.apache.derby.client.net.NetConnectionReply.parseACCRDBreply(Unknown Source)
at org.apache.derby.client.net.NetConnectionReply.readAccessDatabase(Unknown Source)
at org.apache.derby.client.net.NetConnection.readSecurityCheckAndAccessRdb(Unknown Source)
at org.apache.derby.client.net.NetConnection.flowSecurityCheckAndAccessRdb(Unknown Source)
at org.apache.derby.client.net.NetConnection.flowUSRIDONLconnect(Unknown Source)
at org.apache.derby.client.net.NetConnection.flowConnect(Unknown Source)
at org.apache.derby.client.net.NetConnection.<init>(Unknown Source)
at org.apache.derby.client.net.NetConnection40.<init>(Unknown Source)
at org.apache.derby.client.net.ClientJDBCObjectFactoryImpl40.newNetConnection(Unknown Source)
... 4 more


C:\WINDOWS\system32>java org.apache.derby.tools.sysinfo
------------------ Java Information ------------------
Java Version: 1.7.0_09
Java Vendor: Oracle Corporation
Java home: C:\Program Files\Java\jre7
Java classpath: C:\Program Files\Java\jdk1.7.0_09\db\lib\derbytools.jar;C:\Program Files\Java\jdk1.7.0_09\db\
lib\derbynet.jar;.
OS name: Windows XP
OS architecture: x86
OS version: 5.1
Java user dir: C:\WINDOWS\system32
java.specification.name: Java Platform API Specification
java.specification.version: 1.7
java.runtime.version: 1.7.0_09-b05
--------- Derby Information --------
JRE - JDBC: Java SE 7 - JDBC 4.0
[C:\Program Files\Java\jdk1.7.0_09\db\lib\derby.jar] 10.8.2.2 - (1181258)
[C:\Program Files\Java\jdk1.7.0_09\db\lib\derbytools.jar] 10.8.2.2 - (1181258)
[C:\Program Files\Java\jdk1.7.0_09\db\lib\derbynet.jar] 10.8.2.2 - (1181258)
------------------------------------------------------
----------------- Locale Information -----------------
Current Locale : [English/United States [en_US]]
Found support for locale: [cs]
version: 10.8.2.2 - (1181258)
Found support for locale: [de_DE]
version: 10.8.2.2 - (1181258)
Found support for locale: [es]
version: 10.8.2.2 - (1181258)
Found support for locale: [fr]
version: 10.8.2.2 - (1181258)
Found support for locale: [hu]
version: 10.8.2.2 - (1181258)
Found support for locale: [it]
version: 10.8.2.2 - (1181258)
Found support for locale: [ja_JP]
version: 10.8.2.2 - (1181258)
Found support for locale: [ko_KR]
version: 10.8.2.2 - (1181258)
Found support for locale: [pl]
version: 10.8.2.2 - (1181258)
Found support for locale: [pt_BR]
version: 10.8.2.2 - (1181258)
Found support for locale: [ru]
version: 10.8.2.2 - (1181258)
Found support for locale: [zh_CN]
version: 10.8.2.2 - (1181258)
Found support for locale: [zh_TW]
version: 10.8.2.2 - (1181258)
------------------------------------------------------

C:\WINDOWS\system32>java org.apache.derby.tools.ij
ij version 10.8
ij> connect 'jdbc:derby:test';
ij> select * from student;
NAME |AGE
--------------------------------
Swami |28
amit |27

2 rows selected
ij>

Please Help!!
 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

maybe this will help, maybe not.

I have windows xp and have netbeans 7.1 with glassfish 3.1.1 installed.

under netbeans I ran a web app MyWebApp with javaee (entity beans) and placed info in a database "sample". It appears to be
created at C:\Documents and Settings\David\.netbeans-derby\ in the form of a folder named "sample".
Whenever I use netbeans, the glassfish server and the database are started and when I stop netbeans the glassfish server and the database turn off.

I then must copy the folder to %DERBY_HOME%\bin !! when the database is OFF !!
Then with asadmin.bat start-domain and asadmin.bat start-database get the show running again.
Then with the browser and http://localhost:8080/MyWebApp I can look at the database.

But !! don't forget, netbeans puts the database in C:\Documents and Settings\David\.netbeans-derby\ [for some strange reason]
and when using glassfish server like a normal human, without netbeans, the database must be in %DERBY_HOME%\bin [for yet another strange reason]

hope that helps
 
reply
    Bookmark Topic Watch Topic
  • New Topic