Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.sql.SQLException: invalid name pattern:

 
neerav kumar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

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(OracleTypeADT.java:553)
at oracle.jdbc.oracore.OracleTypeADT.init(OracleTypeADT.java:469)
at oracle.sql.StructDescriptor.initPickler(StructDescriptor.java:390)
at oracle.sql.StructDescriptor.<init>(StructDescriptor.java:320)
at oracle.sql.StructDescriptor.createDescriptor(StructDescriptor.java:201)
at oracle.sql.StructDescriptor.createDescriptor(StructDescriptor.java:169)
at oracle.sql.StructDescriptor.createDescriptor(StructDescriptor.java:138)
at oracle.jdbc.driver.NamedTypeAccessor.otypeFromName(NamedTypeAccessor.java:86)
at oracle.jdbc.driver.TypeAccessor.initMetadata(TypeAccessor.java:89)

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

Thanks in advance
 
Paul Clapham
Sheriff
Posts: 21312
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is that really supposed to be "Pakage" instead of "Package"?
 
neerav kumar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is just a dummy name. Please assume that spelling and syntax are correct.
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic