From: <eyr...@ya...> - 2003-04-17 14:55:31
|
Hi guys, As you know I am using Oracle 9i for running the bookstore, and I have some problems: 1) the scripts for the users table don't seem to be right: the date columns should either have a default value, like 'sysdate', or be nullable (I get exceptions from the database when I try to create a new user). Here is the good script, according to me: CREATE TABLE USERS ( USER_OID NUMBER (19) NOT NULL, USERNAME VARCHAR2 (32) NOT NULL, PASSWORD VARCHAR2 (1024) NOT NULL, FIRST_NAME VARCHAR2 (64), MIDDLE_NAME VARCHAR2 (64), LAST_NAME VARCHAR2 (64), USER_TITLE VARCHAR2 (16), USER_ADRESS1 VARCHAR2 (127), USER_ADRESS2 VARCHAR2 (127), USER_ADRESS3 VARCHAR2 (127), USER_PHONE VARCHAR2 (32), USER_MOBILE VARCHAR2 (32), USER_EMAIL VARCHAR2 (1024), USER_GROUP_OID NUMBER (19) NOT NULL, DISABLED NUMBER (1) DEFAULT 0 NOT NULL, CREATED_ON DATE DEFAULT SYSDATE NOT NULL, CREATED_BY VARCHAR2 (32) DEFAULT user, LAST_UPDATE_ON DATE DEFAULT SYSDATE NOT NULL, LAST_UPDATE_BY VARCHAR2 (32) DEFAULT USER, LAST_PASSWD_CHANGE_ON DATE DEFAULT SYSDATE, CHECK (Disabled IN (0, 1)) , CONSTRAINT USERS_U1 UNIQUE (USERNAME) USING INDEX TABLESPACE INDX PCTFREE 10 STORAGE ( INITIAL 128K NEXT 128K PCTINCREASE 0 ), CONSTRAINT USERS_PK PRIMARY KEY ( USER_OID ) USING INDEX TABLESPACE INDX PCTFREE 10 STORAGE ( INITIAL 128K NEXT 128K PCTINCREASE 0 )) TABLESPACE USERS PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE ( INITIAL 128K NEXT 128K PCTINCREASE 0 MINEXTENTS 1 MAXEXTENTS 4096 ) NOCACHE; ALTER TABLE USERS ADD CONSTRAINT USERS_FK1 FOREIGN KEY (USER_GROUP_OID) REFERENCES FWK.USER_GROUP (GROUP_OID) ; 2) I have problems with blobs: JBoss seems to be able to insert them, but not to read them. At the beginning, the tree table was empty, you app seems to have inserted 6 lines, and seems to read them afterwards, but gets exceptions instead. I give you the stacktraces in the attachment. As I get too many problems under Oracle, I am going to try to use MySQL, as it seems to be your prefered platform. ===== C'est au pied du mur qu'on voit le mieux le mur. ___________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com |