Changes

Jump to: navigation, search

NexJ Express Connecting to PostgreSQL

1,358 bytes removed, 21:57, 9 December 2010
no edit summary
== 1- Setup the postgresql-connection ==
For testing the connection, the 'PostgreSQLAdapterTestAllTests.java' is being used.
: Installed the <code> JDBC3 Postgresql Driver, Version 9.0-801 </code> and added it to the libraries in JDK
:: The driver class which is being used for NexJ Express Model is: <code> org.postgresql.xa.PGXADataSource </code>
|}
 
== 2- Create a PostgreSQL database through some scripts==
: Through the process in postgresql_setup.sql, the database was created, initialized and tested:
:: A database called 'test is created in PostgreSQL : <code> CREATE DATABASE test </code>
:: To create a <code>user</code> along with <code>password</code>: <code> CREATE USER test WITH PASSWORD 'test'; </code>
:: Login to the database 'test' with username 'test': <code> psql -U test test </code>
:: Create a <code> Schema </code> called 'test' inside the database 'test' with particular owner 'test': <code> CREATE SCHEMA test AUTHORIZATION test;</code>
:: Create a <code>table</code> called 'Mutex' with primary key: <code> CREATE TABLE test.Mutex(id INT PRIMARY KEY); </code>
:: Insert a value into the primary key: <code> INSERT INTO test.Mutex(id) VALUES (1); </code>
 
== 3- Working inside Schema 'test'==
 
: <code> CREATE TABLE test.xxx </code>
:: data types are changed in <code> appendColumnType() </code> in ''PostgreSQLSchemaManager.java'' based on each jdbc type's equivalent in PostgreSQL.
:: The implementation in <code> crateTextTable </code> in file ''PostgreSQLSchemaManager.java'' is removed for now (base class's version is being called).
: <code>CREATE INDEX test.xxx </code>
: <code> CREATE Trigger test.xxx // if it's needed for PostgreSQL as well as MySQL</code>
1
edit

Navigation menu