This week's book giveaways are in the iOS and Features new in Java 8 forums. We're giving away four copies each of Barcodes with iOS: Bringing together the digital and physical worlds and Core Java for the Impatient and have the authors on-line! See this thread and this one for details.
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.
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.
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.