Normally for a user defined type I can simply do the following (Simplified but functional example):
//Create table
create type myType1 as object( a char(2), b char(2) );
create type myTable1 as table of myType1;
//Java code
ArrayDescriptor des = ArrayDescriptor.createDescriptor( "MYTABLE1", con);
StructDescriptor sDes = StructDescriptor.createDescriptor( des.getBaseName(), con);
//Populte the metadata
String columnName = sDes.getColumnName(0);
int oracleType = sDes.getColumnType(0);
int maxSize = sDes.getColumnDisplaySize(0);
boolean isNullable = sDes.isNullable(0)>0;
Except now I have a table that's defined with a primitive type instead of a struct, and I can't seem to access the metadata. My current code is:
//Create table
create or replace type myTable2 as table of char(2);
//Java code
ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor( "MYTABLE2", con);
//This next line would throw an exception, as CHAR type is not a structure
//StructDescriptor sDes = StructDescriptor.createDescriptor( des.getBaseName(), con);
//Populte the metadata
int oracleType = descriptor.getBaseType(); // This Works
String columnName = "COLUMN_VALUE"; // This Works (I think)
int maxSize = ???? // How do I access the '2'?
boolean isNullable = ???? // How do I access isNullable?