Hello there,

I need an help relating to Java5 enumerated data type and DB2.

Suppose I have something like this in my Java Program

enum Season {WINTER, SPRING, SUMMER, FALL};
Season season=Season.WINTER;
stmt.execute("create table enumtable(id int)");
PreparedStatement pstmt=con.prepareStatement("insert into tab1 values (?)");
System.out.println("OK");
pstmt.setObject(1,season);
System.out.println("Does not come here ");
pstmt.executeUpdate();
con.commit();

The output is this

Invalid data conversion: Parameter instance WINTER is invalid for the requested conversion.

Could someone let me know how do I insert the enumerated data type Object into DB2.
What should the column type be? Is this feature supported ?

Is it not possible to do this, just like the Clob or Blob objects which can be inserted into a Column with Clob or Blob Column types ?

Ashok Jose