Dienstag, 29. Januar 2013

OpenJPA DB2 hellojpa

In order to execute the sample app, you need to create the table in your Database.
In our case the user/owner ist called TESTUSR.
The table definition works fine with the sample, and it has soem adtional features.
CREATE TABLE TESTUSR.MESSAGE (
 ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) PRIMARY KEY,
 CREATED DATE DEFAULT CURRENT_DATE NOT NULL,
 MESSAGE VARCHAR(2000) NOT NULL
);
INSERT INTO TESTUSR.MESSAGE (MESSAGE ) VALUES  ( 'hi2' )
don't forget the configuration of your persistence.xml.
In our case we set 4 parameters.
It is also possible to use a datasource in hosted appserverenvironment.
Because we are assuming the simple we choose to set the minimal necessary parameters.

Keine Kommentare:

Kommentar veröffentlichen