dcsimg
Problem using setDate() in MS sql server(urgent)
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Rajesh_Mohapatra
Posted On:   Monday, October 8, 2001 03:26 AM

I have written the code as following: PreparedStatement preSt=con.prepareStatement("insert into dateTest values(?,?,?,?)"); Calendar cal = Calendar.getInstance(); cal.set( cal.YEAR, 1970 ); cal.set( cal.MONTH, cal.JANUARY ); cal.set( cal.DATE, 1 ); java.sql.Date jsqlD = new java.sql.Date( cal.getTime().getTime() ); preSt.setDate(4,jsqlD); int i=preSt.executeUpdate(); This gives a runtime error. SQLException: Optional feature not implemented. Can anybody help me out of this ?    More>>

I have written the code as following:


PreparedStatement preSt=con.prepareStatement("insert into dateTest values(?,?,?,?)");

Calendar cal = Calendar.getInstance();
cal.set( cal.YEAR, 1970 );
cal.set( cal.MONTH, cal.JANUARY );
cal.set( cal.DATE, 1 );

java.sql.Date jsqlD =
new java.sql.Date( cal.getTime().getTime() );



preSt.setDate(4,jsqlD);

int i=preSt.executeUpdate();


This gives a runtime error.

SQLException: Optional feature not implemented.

Can anybody help me out of this ?

   <<Less

Re: Problem using setDate() in MS sql server(urgent)

Posted By:   Luke_Latimer  
Posted On:   Monday, October 8, 2001 03:49 AM

I had all sorts of problems with dates in MSSQLServer. In the end I passed all dates as strings in the format

yyyyMMdd HH:mm

Hope that helps

About | Sitemap | Contact