I got an error in derby connection in netbeans ide - netbeans

When I try to make a new project in java with the help of the derby database I got the error like "Cannot establish a connection to jdbc:derby://localhost:1527/week1DB using org.apache.derby.jdbc.ClientDriver (DERBY SQL error: ERRORCODE: 40000, SQLSTATE: XJ041, SQLERRMC: Failed to create database 'week1DB', see the next exception for details.::SQLSTATE: XBM0H)"

Related

Cannot see list of drivers in Eclipse (Kepler)

I am trying to learn JDBC. The first step is to connect Oracle DB to eclipse. I installed Oracle XE. Now, when I am trying to connect to eclipse, I do not see a list of drivers.
Also, as according to this page, I cannot see Oracle Database Connection. I only see "Oracle"
I also tried opening the eclipse after cleaning (adding -clean in the .ini file) But it didn't work. What am I missing here?
You can download the JDBC driver from OTN and add it to the classpath.

Resolve missing server in netbeans

I use netbeans 8.1 and glassfish 4.0.When I click persistence.xml-design tab,a warning appears like The project does not have the target server properly.Java persistence features are server-dependent ...
So I don't use JPQL on persistence.xml
Any suggestion?
I found a solution for my QUESTION. If the project has a server, you will show your server to your ejb project. ejb projcet->properties->run and define your server.
I was having the same problem but with the little difference that mine was caused by attempting to downgrade glassfish from version 5.0.1 to 5.0. I had deployed my application using 5.0.1 but some issues with the jdbc drive occurred so I need to downgrade to Glassfish 5.0 and then this appears "The project does not have the target server properly... ", I checked the run properties and everything was all right.
In order to solve: first go to "project properties" and then to "Run" in the server option select apply changes, restart netbeans, open again and change the server again to glassfish

Error 404 running Tomcat from Eclipse

I'm new to Eclipse and to Java Web app but i have to work to a project for school on databases.
I created an Eclipse project form the template they gave us and installed Tomcat v7.0
When I start Tomcat "manually" with startup.sh it start nicely and shows the tomcat homepage to localhost:8080. But when I try to run the project from eclipse on both localhost:8080 and localhost:8080/IntroDBProjectit shows the 404 error report.
I already tried copying the ROOTfolder in ../.metadata/.plugins/org.eclipse.wst.server.core/tmp0/webapps/ (and restarting eclipse) but still it doesn't seem to work.
Can someone help?
I'm working on Mac OSX 10.9.2 / Eclipse Java EE IDE / Tomcat v7.0
Ok I solved the problem.
I simply deleted and reimported the project. I should have done that earlier. I feel dumb -.-

Morphia gives NoClassDefFoundError: com/mongodb/DBObject?

I run Morphia 0.102 with the Mongo Java Client 2-11.2.
This is a client / server app. At the moment I test the server side locally on GlassFish.
Ok, when I run some code on the client, using Mongo and Morphia, no issue. Then when some code is called on the server side, it instantiates Morphia on the server with
mongoClient = new MongoClient("199.00.000.000", 27017);
morphia = new Morphia(); //exception thrown
The exception:
Caused by: java.lang.NoClassDefFoundError: com/mongodb/DBObject
at com.google.code.morphia.Morphia.<init>(Morphia.java:48)
at com.google.code.morphia.Morphia.<init>(Morphia.java:44)
I've spent several hours trying to change the versions of Morphia and the MongoDriver, with no result and I have no clue.
Any idea?
Are you including the morphia jar in your war file? Adding things to that glassfish folder is almost always the wrong answer.
So, adding the jar in the glassfish folder solved this exception when I was running GlassFish locally, from Netbeans. The issue came back when I uploaded my Java EE module on the server.
Adding the mongo and morphia jars in all kinds of folders did not solve anything then. The thing that solved it :
- I integrated my Java EE module into an EAR, then deployed the EAR (before that I was only deploying the Java EE Module without an EAR - surely a very bad practice, but I did not know).

how to connect eclipse rcp application with mysql database

I have created database and Application for my Eclipse RCP project.
now how to connect this project with MYSQL database.
if i am trying to connect it is giving error "class not found".
You can use a JPA provider with support for OSGi bundlers as http://www.eclipse.org/eclipselink/downloads/.
OR
Create a plugin from JDBC driver (plugin from exists jar) and set it as dependent of your applicantion. With this you can to acess the driver class (check OSGi bundle dependency for more details)
The same question has been asked by a user :-
Follow the link
Connecting RCP to database
How to connect to Mysql through Eclipse RCP