Difference between revisions of "NexJ Express Connecting to PostgreSQL"

From CDOT Wiki
Jump to: navigation, search
Line 16: Line 16:
 
| Add code to connect to server
 
| Add code to connect to server
 
| DONE
 
| DONE
|-  
+
|-
 +
| Create Script for Test database
 +
| DONE
 +
|-
 
| Test connection to the server
 
| Test connection to the server
 
| DONE
 
| DONE
Line 34: Line 37:
 
=== Code: 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>
::Create <code>PostgreSQLSchemaManager.java</code> by extending <code>SQLSchemaManager</code>
+
:Create <code>PostgreSQLSchemaManager.java</code> by extending <code>SQLSchemaManager</code>
  
::Edit <code>RelationalDatabase.java</code>
+
:Edit <code>RelationalDatabase.java</code>
::Edit <code>RelationalDatabaseFragment.java</code>
+
:Edit <code>RelationalDatabaseFragment.java</code>
::Edit <code>SQLSchemaManagerFactory.java</code>
+
:Edit <code>SQLSchemaManagerFactory.java</code>
  
 
Package: <code>nexj.core.meta.sys</code>
 
Package: <code>nexj.core.meta.sys</code>
::Edit <code>system.dstypes</code>
+
:Edit <code>system.dstypes</code>
 +
 
 +
=== SQL Scripts ===
 +
Package: <code>nexj.core.persistence.sql.script</code>
 +
:Create
 +
* <code>postgresql_setup.sql</code>
 +
* <code>postgresql_drop.sql</code>
 +
* <code>postgresql_insert.sql</code>
 +
* <code>postgresql_upd_addr.sql</code>
 +
* <code>postgresql_upd_cont.sql</code>
  
 
=== UnitTest: 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>
::Create <code>PostgreSQLSchemaManagerTest.java</code> by extending <code>SQLSchemaManagerTest</code>
+
:Create <code>PostgreSQLSchemaManagerTest.java</code> by extending <code>SQLSchemaManagerTest</code>
  
 
Package: <code>nexj</code>
 
Package: <code>nexj</code>
::Create <code>postgresql.connections</code> using NexJ Studio
+
:Create <code>postgresql.connections</code> using NexJ Studio
::Edit <code>default.config</code> to use PostgreSQL
+
:Edit <code>default.config</code> to use PostgreSQL
::Edit all <code>*.connections</code> files to use PostgreSQL
+
:Edit all <code>*.connections</code> files to use PostgreSQL
  
 
===Configure UnitTests for more than one Database===
 
===Configure UnitTests for more than one Database===

Revision as of 12:50, 11 January 2011

PostgreSQL Adapter for NexJ - Connect to PostgreSQL database

Task Summary

Task Status
Install the PostgreSQL Server DONE
Install PostgreSQL driver DONE
Add code to connect to server DONE
Create Script for Test database DONE
Test connection to the server DONE
Configure UnitTests for multiple DB's

Task Details

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

SQL Scripts

Package: nexj.core.persistence.sql.script

Create
  • postgresql_setup.sql
  • postgresql_drop.sql
  • postgresql_insert.sql
  • postgresql_upd_addr.sql
  • postgresql_upd_cont.sql

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 using NexJ Studio
Edit default.config to use PostgreSQL
Edit all *.connections files to use PostgreSQL

Configure UnitTests for more than one Database