Two Laptop Bag
The moose likes JDBC and Relational Databases and the fly likes java.sql.SQLException: invalid name pattern: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "java.sql.SQLException: invalid name pattern:" Watch "java.sql.SQLException: invalid name pattern:" New topic

java.sql.SQLException: invalid name pattern:

neerav kumar

Joined: Aug 13, 2006
Posts: 4

I am getting this exception when i am executing the stored procedure from java application. I have oracle custom data types define within the package Which i cannot change. When i run the java code following execption is thrown i register the output parameter.

proc_stmt.registerOutParameter(1, OracleTypes.STRUCT, "PakageName.EmployeeType");

java.sql.SQLException: invalid name pattern: PakageName.EmployeeType
at oracle.jdbc.oracore.OracleTypeADT.initMetadata(
at oracle.jdbc.oracore.OracleTypeADT.init(
at oracle.sql.StructDescriptor.initPickler(
at oracle.sql.StructDescriptor.<init>(
at oracle.sql.StructDescriptor.createDescriptor(
at oracle.sql.StructDescriptor.createDescriptor(
at oracle.sql.StructDescriptor.createDescriptor(
at oracle.jdbc.driver.NamedTypeAccessor.otypeFromName(
at oracle.jdbc.driver.TypeAccessor.initMetadata(

I tried lot to find the solution but i havent got any solution on internet.

Thanks in advance
Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

Is that really supposed to be "Pakage" instead of "Package"?
neerav kumar

Joined: Aug 13, 2006
Posts: 4
It is just a dummy name. Please assume that spelling and syntax are correct.
Martin Vajsar

Joined: Aug 22, 2010
Posts: 3733

It's not going to work with types declared in PL/SQL package. You need to declare SQL type (using Oracle's CREATE TYPE SQL statement). Such type can be used in a package and from JDBC.

See also this thread.

I agree. Here's the link:
subject: java.sql.SQLException: invalid name pattern:
It's not a secret anymore!