Database for Java Enterprise Edition - eclipse

I'm starting to use Java EE developing on Eclipse IDE, using GlassFish and the default Java database. What I should do if I want to change the database to Oracle?
The application runs on Glassfish and Google App Engine. But is there a way from Eclipse to deploy it to my own server?

You should be able to deploy locally to Glassfish and Oracle using Eclipse. (It's easy to do with IntelliJ.)
All you have to do to use Oracle is add the JDBC driver JAR to the appropriate spot in your CLASSPATH, use the new driver .class, and change the connection URL.
The driver JAR should match your JDK (e.g., ojdbc6.jar) and database version. It should come with your database or you can download it here.
I don't know if the JAR should go in your WEB-INF/lib or a server /lib; consult your docs to be sure.
One more thing: it goes without saying that you'll have to set up Oracle (e.g., proper credentials), create the new schema, and add the tables and indexes before you run your Java app. I thought I'd spell it out to be safe.

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.

Add Derby Nature in Eclipse

I have installed the new version of eclispe and derby. I have also the three directories (ui, core and plugin doc).
Still to get derby server started, I only mange to do it from outside eclipse. I cannot manage to start the server from within eclipse or add derby nature to a project.
Can anyone helpout?

NetBeans: create Entity from Database

I need to reverse engineer my database tables into Entity to run a Java EE project on JBoss AS 7. So I've added into the Services the JBoss application server and added as well as resources a MySQL datasource.
However, when I try to run the wizard Create Entity from Database I can see as only option the default ExampleDS Database. There is no other option to create a new DataSource or use the MySQL DataSource that I've installed on JBoss.
I wonder if it's a NetBeans bug, or I'm missing something. I'm using NetBeans 8.0.1 version.
I think it's an issue with the plugin that you are using for connecting to the application server. I remember I had this issue when I first tried to generate Entity classes from a Database using a Datasource on WildFly. Are you sure that the target application server is JBoss AS 7 and not WildFly ?
If so, try to connect the application to a JBoss AS 7 /EAP 6 instead and see if it works.
Hope it helps
Edit: I've included a JBoss NetBeans tutorial which shows the steps for reverse engineering database tables into Entity classes (and then JSF pages).

Configuring JDeveloper to use PostgreSQL

I have a Java project which uses Struts and Hibernate. I am using PostgreSQL as the database for the project.
I have imported the .jws file in JDeveloper. All the java and jsp files are imported to the project.
When I tried to run the project multiple errors came out. I think it's due to a database connection failure.
Do I need to configure pgsql with the project?
Thanks in advance.
You have to provide more info on what the errors are.
But some common problem in JDeveloper when using the bundled server to test is that (if you are using datasources) you have to place the driver jars in the server lib folder or declare it as a Library by going to Tools->Manage Libraries.
If you post what errors are you receiving and how are you connecting to the database we might be able to help you a little more.
You'll need to add the postgreSQL jdbc jar files to your project and to the embedded WebLogic instance.
Tell us the specific error you are getting and we'll help you more.

Configuring Mojarra 2.1.X on Eclipse Indigo

The User Library download from Properties/Project Facets/Java Server Faces only lists Apache and Mojarra 2.0.X options. And setting up a user library manually, if I add javax.faces-2.1.11.jar, it doesn't error, puts the jar in the entry, then says \jarfiles\jaf (missing). So I see no way to use Mojarra 2.1.X.
I am unable to understand completely that what are you saying? But as much as I can I understood that "you want you use Mojarra 2.1.X" in your project. Now here is the thing You should mention the server that you are using.
If you are using glassfish 3.1.x then you have to replace your javax.faces.jar present in /glassfish/modules folder with javax.faces-2.1.11.jar as the glassfish built in jar javax.faces.jar enforce glassfish to use Mojarra 2.1.6.Now if it is Tomcat then it is up to you that you have to add all jsf compulsory jars in your lib folder :) One last thing that if you are using anyother server which has built in support for JSF and you are unable to find How to replace your jar from that server or you have issue with admin access over that server then you can also upgrade JSF by placing the newer javax.faces.jar file in webapp's own /WEB-INF/lib folder and editing the /WEB-INF/glassfish-web.xml file to add the following two new entries: <class-loader delegate="false" /><property name="useBundledJsf" value="true" />.Keep in mind that you are only enforce Web servers to use your desired jars not the application servers because many applications servers are giving built in support for JSF. So Configuring Mojarra 2.1.X on Eclipse Indigo is somehow wrong to ask.You have to ask that how should I use Mojarra 2.1.x with my XXX server because eclipse is only IDE and these things are SOMEHOW managed by IDE but only in case of Webservers.Thanks :)