You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by yt <ts...@usa.net> on 2000/12/03 02:15:44 UTC

jjdbc setNull to create nested table

Hi Craig,
I'm having a problem with jdbc creating a nested object table in 
oracle8i.

eg in oracle 8i, you create the object table using this code :

create  type phone_number  as Object
(phone_no varchar2(12),
  phone_type   char(1));

create type  all_phones  as table of phone_number;

// now create the nested table :
               
create table cust_phones
( cust_no   varchar2(8),
cust_name  varchar2(20),
phone_nos  all_phones)
nested table phone_nos  store as all_phones_nst;


insert into cust_phones values ('joey123','joey smith', all_phones()); 
is a query which works fine in oracle sql plus. It will put null values 
into the nested table all_phones. Which is exactly what I want.

But trying to run it from a java class through jdbc, like this :

String sql = "INSERT INTO CUST_PHONES VALUES (?,?,?);";
					
			PreparedStatement pstmt = null;
		pstmt = conn.prepareStatement(sql);

			pstmt.setString(1, "joey123");

			pstmt.setString(2, "joey smith");

			pstmt.setNull(3, java.sql.Types.STRUCT, "all_phones");


will give an error like this :
java.sql.SQLException: ORA-00911: invalid character

Let me know if you have any idea on how to fix this jdbc problem. 
If I use a regular stmt.execute(sql), it works fine and puts the null 
values into the table. Thanks in advance for your help.

  

Using mod_jk.so

Posted by Alan Wright <At...@btinternet.com>.
I am trying to use mod_jk instead of mod_jserv.so

should I do anything about the  AddHandler jserv-servlet .jsp directive in
httpd.conf?

Is there something that should be in its place?

I am finding the documentation relating to the use of mod_jk confusing because the
examples have lots of jserv stuff in them.


Alan Wright