15 September 2011

JDBC PostgreSQL in JDeveloper

Here is how to solve postgresql jdbc driver installation for JDeveloper WebLogic 10.3.

1.) Download the driver from here (http://jdbc.postgresql.org/download.html). You will probably want to download the JDBC 4 driver. The downloaded file will be .zip, eventhough the weblogic requires .jar. :-) For those who are beginners should know that Sun used .jar which is just another .zip file. Therefore rename the downloaded .zip to .jar.

2.) You can copy the file to C:\Oracle\Middleware\wlserver_10.3\server\lib .

3.) Open the following file C:\Oracle\Middleware\wlserver_10.3\common\bin\commEnv.cmd.

4.) Find the following line

set WEBLOGIC_CLASSPATH=%JAVA_HOME%\lib\tools.jar;%WL_HOME%\server\lib\weblogic_sp.jar;%WL_HOME%\server\lib\weblogic.jar;%FEATURES_DIR%\weblogic.server.modules_10.3.3.0.jar;%WL_HOME%\server\lib\webservices.jar;%ANT_HOME%/lib/ant-all.jar;%ANT_CONTRIB%/lib/ant-contrib.jar

and append ;%WL_HOME%\server\lib\postgresql-8.4-701.jdbc4.jar

so it becomes

set WEBLOGIC_CLASSPATH=%JAVA_HOME%\lib\tools.jar;%WL_HOME%\server\lib\weblogic_sp.jar;%WL_HOME%\server\lib\weblogic.jar;%FEATURES_DIR%\weblogic.server.modules_10.3.3.0.jar;%WL_HOME%\server\lib\webservices.jar;%ANT_HOME%/lib/ant-all.jar;%ANT_CONTRIB%/lib/ant-contrib.jar;%WL_HOME%\server\lib\postgresql-8.4-701.jdbc4.jar

5.) Make sure that the postgresql-8.4-701.jdbc4.jar reflects the postgres driver filename which you downloaded

6.) Restart the server

7.) Now if you go inside the Weblogic admin console and create a datasource you should be able to successfully test the configuration

    Driver Class = "org.postgresql.Driver";
    JDBC URL = "jdbc:postgresql://localhost:5432/neosoft";
    USER = "postgres";
    PASSWORD = "postgres";

source : Oracle Forum

3 comments:

Unknown said...

Great!!!, You are a Genius, Thanks

Unknown said...

thanks very much

Shirley A said...

Loved reeading this thanks