wood burning stoves 2.0*
The moose likes JDBC and the fly likes invoke SQL server 2008 stored procedure from java and mapping pojo with Custom Database type Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "invoke SQL server 2008 stored procedure from java and mapping pojo with Custom Database type" Watch "invoke SQL server 2008 stored procedure from java and mapping pojo with Custom Database type" New topic
Author

invoke SQL server 2008 stored procedure from java and mapping pojo with Custom Database type

Poonam Kadu
Ranch Hand

Joined: Jul 21, 2006
Posts: 49
Hi Friends,

I have declared a UDT(User Defined Types) say CustomType in SQL server 2008.I m using this Data type as an IN parameter for a Stored
procedure.I want to call this procedure from a java class.
To do this i have done the following:
created a class called CustomType which implements SQLData



My main java class looks like this:


when i run this code i get the following exception:

com.microsoft.sqlserver.jdbc.SQLServerException: This operation is not supported.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.NotImplemented(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.setTypeMap(Unknown Source)
at com.mindcraft.test.Proc2Test.msmsqlTest(Proc2Test.java:97)
at com.mindcraft.test.Proc2Test.main(Proc2Test.java:22)



This exception occurs at con.setTypeMap(map)


My problem is how do i call a store proc of SQL server, whose input parameter is a custom Database type?
How do i map the a pojo with custom database type of SQL server 2008 and send that to the stored proc ?
Does sql server 2008 jdbc driver implement Connection.setTypeMap() method?


cheers,
Poonam.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: invoke SQL server 2008 stored procedure from java and mapping pojo with Custom Database type
 
Similar Threads
Stored Procedure and Java
Character Set Unknown issue using datasource in JBOSS server
Java to OODBMS code in Oracle --- Please help me out
Storing Objects using SQLData Interface
Passing Nested Type from Java to DB