hi
<obligatory> I am a newbie to commons project, also to
the commons-sql subproject. I just installed maven
and eclipse... I guess you get the idea!
</obligatory>
I am trying to use commons-sql(to do inserts ona
tables dynamically) on Oracle 8.1.7 and I am running
into couple of issues
I created TestOracleDbDynaSql.java (modelled exacly
like TestHsqlDbDynaSql.java) and ran Junit test cases
(invoked using maven java:jar)
(1) When creating the table
create table coltype
(
COL_INTEGER INTEGER NULL ,
COL_FLOAT FLOAT NULL ,
COL_DECIMAL DECIMAL (15,3) NULL ,
COL_DEC_NOSCALE DECIMAL (15,0) NULL ,
COL_CHAR CHAR (15) NULL ,
COL_VARCHAR VARCHAR (15) NULL ,
COL_DATE DATE NULL ,
COL_TIME TIME NULL ,
COL_TIMESTAMP TIMESTAMP NULL
);
The following error has occurred:
ORA-00902: invalid datatype
The datatype that it is complaining on is "TIME"
(2) When I look through toad, it looks like the pre
insert trigger on the table "book" did not get created
properly. It had
begin
select book_seq.nextval into :new.book_id from dual
and the "end" token was missing
(3) I am not too sure yet, but it "seems" that if we
created the table names and the columns all uppercase,
then the dynasql.copy() fails...
code snippet
============
DynaBean bean = (DynaBean) iter.next();
assertTrue("Found a dynaBean row", bean !=
null);
log.info( "Found book: " + bean.get("title")
);
assertEquals( "bean has corrrect isbn",
"ISBN-XYZ", bean.get("isbn") );
assertEquals( "bean has corrrect title", "The
Hanging Garden", bean.get("title") );
DynaBean bean2 = dynaSql.copy("book", bean);
assertTrue("Copied a dynaBean ", bean2 != null);
assertEquals( "bean2 has corrrect isbn",
"ISBN-XYZ", bean2.get("isbn") );
log.info( "bean2 isbn: " + bean2.get("isbn") );
assertEquals( "bean2 has corrrect title", "The
Hanging Garden", bean2.get("title") );
log.info( "bean2 title: " + bean2.get("title") );
(4) It is a general maven question, how do I create a
test report for the new test case
TestOracleDbDynaSql.java?
Any help is resolving these issues would be greatly
appreciated!
Thanks
ramana
Log of the Junit of TestOracleDbDynaSql attached
=================================================
Jan 29, 2003 2:02:26 PM
org.apache.commons.sql.util.DDLExecutor evaluateBatch
SEVERE: Command failed: drop table coltype CASCADE
CONSTRAINTS. Reason: java.sql.SQLException: ORA-00942:
table or view does not exist
Jan 29, 2003 2:02:26 PM
org.apache.commons.sql.util.DDLExecutor evaluateBatch
SEVERE: Command failed:
-------------------------------------------------------------------------
-- book
-------------------------------------------------------------------------
create sequence book_seq. Reason:
java.sql.SQLException: ORA-00955: name is already used
by an existing object
Jan 29, 2003 2:02:27 PM
org.apache.commons.sql.util.DDLExecutor evaluateBatch
WARNING: java.sql.SQLWarning: Warning: execution
completed with warning
Jan 29, 2003 2:02:27 PM
org.apache.commons.sql.util.DDLExecutor evaluateBatch
SEVERE: Command failed: end. Reason:
java.sql.SQLException: ORA-00900: invalid SQL
statement
Jan 29, 2003 2:02:27 PM
org.apache.commons.sql.util.DDLExecutor evaluateBatch
WARNING: java.sql.SQLWarning: Warning: execution
completed with warning
Jan 29, 2003 2:02:27 PM
org.apache.commons.sql.util.DDLExecutor evaluateBatch
SEVERE: Command failed:
-------------------------------------------------------------------------
-- coltype
-------------------------------------------------------------------------
create table coltype
(
COL_INTEGER INTEGER NULL ,
COL_FLOAT FLOAT NULL ,
COL_DECIMAL DECIMAL (15,3) NULL ,
COL_DEC_NOSCALE DECIMAL (15,0) NULL ,
COL_CHAR CHAR (15) NULL ,
COL_VARCHAR VARCHAR (15) NULL ,
COL_DATE DATE NULL ,
COL_TIME TIME NULL ,
COL_TIMESTAMP TIMESTAMP NULL
). Reason: java.sql.SQLException: ORA-00902: invalid
datatype
Jan 29, 2003 2:02:27 PM
org.apache.commons.sql.util.DDLExecutor evaluateBatch
WARNING: java.sql.SQLWarning: Warning: execution
completed with warning
Jan 29, 2003 2:02:27 PM
org.apache.commons.sql.util.DDLExecutor evaluateBatch
INFO: Executed: 12 statement(s) with 4 error(s)
Jan 29, 2003 2:02:27 PM
org.apache.commons.sql.dynabean.AbstractTestDynaSql
testInsert
INFO: Inserted author:
org.apache.commons.sql.dynabean.SqlDynaBean@1484a05
Jan 29, 2003 2:02:27 PM
org.apache.commons.sql.dynabean.AbstractTestDynaSql
testInsert
INFO: Inserted author:
org.apache.commons.sql.dynabean.SqlDynaBean@1e78fc6
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]