twitter
    Find out what I'm doing, Follow Me :)
Showing posts with label DBMS. Show all posts
Showing posts with label DBMS. Show all posts

DataNucleus AccessPlatform 3.0





The DataNucleus AccessPlatform provides persistence and retrieval of data to a range of datastores using a range of APIs, with a range of query languages. Software for persistence typically only caters for one type of datastore, or one API. DataNucleus is unique in that it supports all standardised persistence APIs for a very wide range of datastores . DataNucleus is the only persistence software certified JDO compliant. DataNucleus is continually innovating and pushing capabilities forward, as well as continually pushing forward the JDO spec. DataNucleus gives you the power to swap persistence API, and datastore when you want to. In fact it allows JPA mapping data to be used with JDO persistence, and vice versa - another unique feature of DataNucleus. Time to take advantage of this power ...


DataNucleus - Tutorial for JDO
An application can be JDO-enabled via many routes depending on the development process of the project in question. For example the project could use Eclipse as the IDE for developing classes. In that case the project would typically use the DataNucleus Eclipse plugin. Alternatively the project could use Ant, Maven or some other build tool. In this case this tutorial should be used as a guiding way for using DataNucleus in the application. The JDO process is quite straightforward.
  1. Step 0 : Download DataNucleus AccessPlatform
  2. Step 1 : Design your domain/model classes as you would do normally
  3. Step 2 : Define their persistence definition using Meta-Data.
  4. Step 3 : Compile your classes, and instrument them (using the DataNucleus enhancer).
  5. Step 4 : Generate the database tables where your classes are to be persisted.
  6. Step 5 : Write your code to persist your objects within the DAO layer.
  7. Step 6 : Run your application.
  8. Step 7 : Things to add.
The tutorial guides you through this. You can obtain the code referenced in this tutorial from SourceForge (one of the files entitled "datanucleus-samples-tutorial-*").

Install PostgreSQL 8.4 on Ubuntu 10.10


PostgreSQL is a database management system relational database and object-oriented free, released under the BSD license.


Installation
To install from Ubuntu to run in console the following line:
sudo apt-get install postgresql postgresql-client pgadmin3
This installs the engine and pgadmin3 client, a graphical tool to manage databases.
The next thing is to change the administrator password system PostgreSQL:
sudo passwd postgres
Now we must change the password of "user postgres" on the engine, it first entered with the following line:
psql -h localhost -U postgres -W template1
and then enter the following command:
ALTER USER postgres WITH PASSWORD 'password';
Finally out of postgres, enter the following command:
\q
With this we have installed PostgreSQL. Settings
We set up remote access to our motor. This step is optional, only if you want to allow access to our server from other hosts.
First we edit the file postgresql.conf:
sudo gedit /etc/postgresql/8.4/main/postgresql.conf
Look for the line:
# Listen_addresses = 'localhost'
and change it to:
listen_addresses = '*'
We also look for the following line:
# Password_encryption = on
and change it to:
password_encryption = on
Now we edit the file "pg_hba.conf"
sudo gedit /etc/postgresql/8.4/main/pg_hba.conf
 
Modify the lines:

# Database administrative login by UNIX sockets
local   all         postgres                          ident

# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD

# "local" is for Unix domain socket connections only
local   all         all                               ident
# IPv4 remote connections:
host    all         all         194.116.73.46/0          md5
# IPv4 local connections:
host    all         all         127.0.0.1/32          md5
# IPv6 local connections:
host    all         all         ::1/128               md5

We do this to use MD5 authentication with the user postgres.

Finally sent to restart:
sudo /etc/init.d/postgresql-8.4 restart
More information about the configuration: http://www.linux-es.org/node/660

Pgadmin3
The following video shows how to connect to PostgreSQL pgadmin3 and how to use: