• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Every time you till, you lose 30% of your organic matter. But this tiny ad is durable:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic