• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

contents of Map Object in setTypeMap?

 
Raj Chila
Ranch Hand
Posts: 128
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I wonder if some one could give me a quick intro to what the Map Objects keys and corresponding values should be?

I have some proprietory Datatypes, in a proprietory Persistence Framework, and we have to depend on reflection to convert the type to "JDBC type" at runtime. I think we dont have to do this if we can set the TypeMap at the time of the Creation of the connection. so any Idea of how to create the Map?

the getTypeMap returns an Empty map, and the javadoc says it will be empty till we set something to it.

any hints would be welcome.

Thanks in advance
 
Raj Chila
Ranch Hand
Posts: 128
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I think I found a resource on this. thought it would be worthwhile to share it. we need to specify the key as a String, and then the type that we provide as the value should implement the SQLData Interface and put the pair into the Map...I noted that the JDBC specs suggest not to set a new Map Onject whic could possibly over write the existing mappings, rather to get the reference of the map through the getTypeMap and then add the new mappings to it and then set the type mapping to the connection using the setTypeMap method.

Hope this is informative to those interested.

Thanks any way...
 
Raj Chila
Ranch Hand
Posts: 128
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adding to the previous post...
...The above mentioned type mapping works only for the types that are defined in the database ( some user Defined Datatype... for example "Address" Type) and the key name has to be one that is defined in the database ("schemaname.type")
This is not what I was looking for...so I guess we still have to look for a way to convert the Persistence Layer Datatypes to the SQL types.

so back to where I started
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34237
341
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RajaniKanth,
I don't know the answer to your question, but it I found your posts interesting to read.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic