Difference between revisions of "NexJ Express Connecting to PostgreSQL"

From CDOT Wiki
Jump to: navigation, search
Line 7: Line 7:
 
== Install PostgreSQL JDBC3 driver ==  
 
== Install PostgreSQL JDBC3 driver ==  
 
Download: <code> JDBC3 Postgresql Driver, Version 9.0-801 </code> @ http://jdbc.postgresql.org/download.html  
 
Download: <code> JDBC3 Postgresql Driver, Version 9.0-801 </code> @ http://jdbc.postgresql.org/download.html  
Install: Copy driver to [jdk folder]/jre/lib/ext
+
<br/>Install: Copy driver to [jdk folder]/jre/lib/ext
  
== Coding: Add PostgreSQL Driver ==
+
== Code: Add PostgreSQL Driver ==
 
Package: <code>nexj.core.persistance.sql</code>
 
Package: <code>nexj.core.persistance.sql</code>
 
::Create <code>PostgreSQLAdapter.java</code> by extending <code>SQLAdapter</code>
 
::Create <code>PostgreSQLAdapter.java</code> by extending <code>SQLAdapter</code>
Line 21: Line 21:
 
::Edit <code>system.dstypes</code>
 
::Edit <code>system.dstypes</code>
  
== UnitTests: Test Connectivity to database ==
+
== UnitTest: Test Connectivity to database ==
 
Package: <code>nexj.core.persistance.sql</code>
 
Package: <code>nexj.core.persistance.sql</code>
 
::Create <code>PostgreSQLAdapterTest.java</code> by extending <code>SQLAdapterTest</code>
 
::Create <code>PostgreSQLAdapterTest.java</code> by extending <code>SQLAdapterTest</code>
Line 33: Line 33:
 
TODO: find out how to configure UnitTests for more than one Database
 
TODO: find out how to configure UnitTests for more than one Database
  
 +
<!--
 
== Setup the postgresql-connection ==
 
== Setup the postgresql-connection ==
 
For testing the connection, the 'AllTests.java' is being used.
 
For testing the connection, the 'AllTests.java' is being used.
Line 72: Line 73:
 
:: filestorage.connections
 
:: filestorage.connections
 
::filestoragefragment.connections
 
::filestoragefragment.connections
 +
-->

Revision as of 12:08, 11 January 2011

PostgreSQL Adapter for NexJ - Connect to PostgreSQL Driver

Install PostgreSQL

Download: Installer version Version 9.0.1-1 from list of PostgreSQL downloads.

Install PostgreSQL JDBC3 driver

Download: JDBC3 Postgresql Driver, Version 9.0-801 @ http://jdbc.postgresql.org/download.html
Install: Copy driver to [jdk folder]/jre/lib/ext

Code: Add PostgreSQL Driver

Package: nexj.core.persistance.sql

Create PostgreSQLAdapter.java by extending SQLAdapter
Create PostgreSQLSchemaManager.java by extending SQLSchemaManager
Edit RelationalDatabase.java
Edit RelationalDatabaseFragment.java
Edit SQLSchemaManagerFactory.java

Package: nexj.core.meta.sys

Edit system.dstypes

UnitTest: Test Connectivity to database

Package: nexj.core.persistance.sql

Create PostgreSQLAdapterTest.java by extending SQLAdapterTest
Create PostgreSQLSchemaManagerTest.java by extending SQLSchemaManagerTest

Package: nexj

Create postgresql.connections
Edit default.config to use PostgreSQL
Edit all *.connections files to use PostgreSQL

TODO: find out how to configure UnitTests for more than one Database