This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to deal with incomaptibilities among the data types  RSS feed

 
Hareesh Ram Chanchali
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

I there any way to deal with incompatibilities of datatypes.

Is there any type of coding which is generic for all kinds of drivers

I am writing a generic application in which it has to work uniformly

will the getColumnType function of ResultSetMetaData result in the same number(which represents the data type ) for all kind of drivers..

if not how we can deal that problem

Do all drivers support all kinds of data types
are there any limitations for them ( I fell JDBC ODBC bridge does not support LOBs)

please clear my doubts
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37384
531
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hareesh,
The best way of dealing with data type incompatibilities is to use simple data types. If you only use the basic types (varchar, numeric and date), there shouldn't be any inconsistencies. The advanced types (like clob) are not universally supported.

Yes, getColumnType always uses the same numbers. These constants are defined in java.sql.Types.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!