posted 18 years ago
Hi,
Please let me know what is wrong with the piece of code below:-
SimpleDateFormat df = new SimpleDateFormat("M/d/yyyy");
Calendar cal = Calendar.getInstance();
java.util.Date date = df.parse("05/10/2005");
cal.setTime(date);
System.out.println("cal: " +cal.getTime());
CallableStatement cs = con.prepareCall("{ CALL dbo.spData(?,?) }");
cs.setDate(1,new java.sql.Date(cal.getTime().getTime()));
I get the following exception...
java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Optional feature not implemented
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLBindInParameterDate(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.setDate(Unknown Source)
at TestChannelData.main(TestChannelData.java:32)