Configuring JDeveloper to use PostgreSQL - 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.

Related

ClassNotFoundException:com.microsoft.sqlserver.jdbc.SQLServerDriver after migration to liferay 7 from liferay 6.2

I get below error in console when deploying each portlet after migration to liferay 7 which was working fine with liferay 6.2
ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver cannot be found by MAIPF_MyAccount-portlet_7.0.0.1
SQLException: No suitable driver found for jdbc:jtds:sqlserver://IDPLaptop/MAIPF2012_dev_VR7
My guess is that you fell into a common issue I keep seeing on StackOverflow when people try to upgrade to Liferay 7: libraries within the server's lib are not visible for all portlets.
With the ability to code OSGi modules,if one moves their portlet to an OSGi bundle, they need to keep track of the dependencies that module require.
As the jar you are using is not a bundle, you will need to create a uber bundle or use compileInclude to create a fat jar for your module.
Liferay 7, out of the box, does only support open source databases. As you state that you're using Service Builder, you might need to install Antonio's SQLServer integration or move to the commercial offering, Liferay DXP.
Check Victor's answer as well. I commonly use open source databases and DXP anyways, so the nitty-gritty-details that are hidden here are only my theoretical knowledge, I rarely get to experience this in practice.

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.

How to solve SplitsrcTargetPreparation exception in Oracle weblogic server?

I am trying to run a simple Restful web service example on oracle weblogic server . but i am getting this issue while run the project on server. Publishing to Oracle Weblogic server at localhost has encountered a problem.Runtime exception occurred in publish task 'SplitsrcTargetPreparation'.
Have a look on screen sort.What i have to do ?
None of the other answers solved my problem, but I finally found a solution. I'm not claiming that this is the best or only way of resolving this issue, but it worked for me. Hope it helps others.
Open the Properties of your WebLogic server instance in Eclipse. Select Publishing. Set the publishing mode to "Publish as an exploded archive". You will no longer get a split source error.
Check the following.
Maven version – If you have imported as a maven project then make
sure that maven version is compatible to the java version you are
using.
Makes sure that you are using the java from the Middleware
which is comes bundled with weblogic.
New domain – Corrupt domain
may also cause this. Create a new domain

Oracle Driver not found

My tomcat web app isn't loading the oracle driver any longer. I moved tomcat and messed with the server definition. Its up and running but can't connect to Oracle due to a missing driver.
I had similar problem with log4j and other libs but adding the lib into the Deployment Assembly of the web app properties solved those issues.
The Oracle lib is there as is its odbc6.jar.
I also tried copying it to WEB-INF/lib with to no avail.
I have a hunch this is a class path problem but I'm not sure how to fix it. I'm also concerned that tomcat can find other libs but not the oracle liv.
SQLException: No suitable Driver Found for jdbc:oracle:thin:#//localhost:1521/orcl
Fixed. I removed the server from the eclipse server window. Clean the project. Added the server back in. Cleaned and rebuild and it worked.

Database for Java Enterprise Edition

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.