| Author |
contents of Map Object in setTypeMap?
|
Raj Chila
Ranch Hand
Joined: Mar 18, 2004
Posts: 125
|
|
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
Joined: Mar 18, 2004
Posts: 125
|
|
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
Joined: Mar 18, 2004
Posts: 125
|
|
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
internet detective
Marshal
Joined: May 26, 2003
Posts: 26168
|
|
RajaniKanth, I don't know the answer to your question, but it I found your posts interesting to read.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
 |
|
|
subject: contents of Map Object in setTypeMap?
|
|
|