aspose file tools*
The moose likes JDBC and the fly likes invalid name patter error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "invalid name patter error" Watch "invalid name patter error" New topic
Author

invalid name patter error

Suketu Bharatia
Greenhorn

Joined: May 27, 2004
Posts: 1
Hi,
Kindly help me out with this.
I have a stored procedure written in Oracle :
PROCEDURE sp_bget_cell_system_info (
p_lac OUT numarray,
p_cellidvalue OUT numarray,
p_sysinfolac OUT numarray,
p_sysinfocellid OUT numarray,
p_sysinfomcc OUT numarray,
p_sysinfomnc OUT numarray
);
where numarray is a userdefined type as a table of number.

I want to execute this stored proc using Java's CallableStatement and get the values returned by the database.
How do I register these out parameters using the registerOutParameter method?
I tried the following way:
//Code
Class.forName("oracle.jdbc.driver.OracleDriver");
String url = "jdbc racle:thin:@smlcpt5:1521:T001";
Connection conn = DriverManager.getConnection(url,"system","manager");

Hashtable newMap = new Hashtable();
newMap.put("smlcpt5:1521:T001.NUMARRAY", Class.forName("NUMARRAY"));

conn.setTypeMap(newMap);
Map myMap = conn.getTypeMap();
System.out.println("SIZE IS = " + myMap.size());

String command = "{call sp_bget_cell_system_info(?,?,?,?,?,?)}";
CallableStatement cstmt = conn.prepareCall(command);

cstmt.registerOutParameter(1,Types.ARRAY,"smlcpt5:1521:T001.NUMARRAY");
cstmt.registerOutParameter(2,Types.ARRAY,"smlcpt5:1521:T001.NUMARRAY");
cstmt.registerOutParameter(3,Types.ARRAY,"smlcpt5:1521:T001.NUMARRAY");
cstmt.registerOutParameter(4,Types.ARRAY,"smlcpt5:1521:T001.NUMARRAY");
cstmt.registerOutParameter(5,Types.ARRAY,"smlcpt5:1521:T001.NUMARRAY");
cstmt.registerOutParameter(6,Types.ARRAY,"smlcpt5:1521:T001.NUMARRAY");
//Code end

But when I execute this, I get the following error :
SIZE IS = 1
Got an exception!
Error Message = invalid name pattern: smlcpt5:1521:T001.NUMARRAY
java.sql.SQLException: invalid name pattern: smlcpt5:1521:T001.NUMARRAY
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:211)
at oracle.jdbc.oracore.OracleTypeADT.initMetadata(OracleTypeADT.java:425)
at oracle.jdbc.oracore.OracleTypeADT.init(OracleTypeADT.java:344)
at oracle.sql.ArrayDescriptor.initPickler(ArrayDescriptor.java:1002)
at oracle.sql.ArrayDescriptor.<init>(ArrayDescriptor.java:132)
at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:97)
at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:173)
at InsertStoredProcedure.main(InsertStoredProcedure.java:32)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: invalid name patter error
 
Similar Threads
ArrayDescriptor Urgent
Getting array of Oracle Objects
Passing Array as a parameter to Stored procedures
java.sql.SQLException: invalid name pattern: PFEP.file_import_nestedtable
calling stored function