Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to deal with incomaptibilities among the data types

 
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: 35976
422
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.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!