jisteinberg
jisteinberg

Reputation: 71

After Installing NetBeans 8.0.2 with GlassFish 4.1 Cannot Connect to sample Database

I installed NetBeans 8.0.2 with glassfish-4.1. The sample folder is present under C:\Users\Username.netbeans-derby. When I bring up NetBeans and go to the Services tab the connection to sample is present: jdbc:derby://localhost:1527/sample [app on APP] but sample is not listed under Java DB so when I try to connect to sample I get the following error "Unable to connect. Cannot establish a connection to jdbc:derby://localhost1527/sample using org.apache.derby.jdbc.ClientDriver (The connection was refused becuase the database sample was not found)."

Upvotes: 1

Views: 4645

Answers (3)

Adam Milecki
Adam Milecki

Reputation: 1796

The same thing happened to me and re-installing NetBeans did not help. After poking around the databases for a bit, I finally got mine working using the following process.

  1. Create a new database with any properties (i.e. name, user, pw)
  2. Navigate to your user directory \.netbeans-derby\{name}\
  3. Copy service.properties file and paste in \.netbeans-derby\sample\
  4. Reconnect to sample database in NetBeans

A couple extra notes:

  • If you configured your NetBeans database to a different location, use that location in step 2.
  • You may need to delete and re-create the existing sample database connection in NetBeans for it to pickup the new service.properties file.

Upvotes: 0

Harald
Harald

Reputation: 1

I had a broken database from an earlier version too, and then couldn't connect to the sample db. I simply had to delete the .netbeans-derby directory, then reinstalled Netbeans, and is was ok, then.

Upvotes: 0

SubOptimal
SubOptimal

Reputation: 22983

Right click on Java DB select Create Database.

  • use as Database Name 'sample'
  • use as User Name 'app'
  • leave the password empty

edit Seems there is a broken database or maybe one from an earlier Netbeans installation. Remove the sample connection in Netbeans and remove the directory %USERPROFILE%\.netbeans-derby\sample. Recreate the sample database as described above.

Upvotes: 0

Related Questions