Optional Feature Not Implemented

hello,

I get this Error "OptionalFeature Not Implemented", whenever I execute the following code.Attached below is a snippet.

Can someone please help me rectify the error.

String Flt_id = req.getParameter("FlightIdFld");

String strdate = req.getParameter("DateFld");

String TotalSeats = req.getParameter("TotalSeatsFld");

String ExecSeats = req.getParameter("ExecutiveFld");

String EcoSeats = req.getParameter("EconomyFld");

SimpleDateFormat sdf;

java.util.Date util_date1 =null;

java.sql.Date sql_date1 =null;

java.sql.Date date =null ;

try

{

sdf =new SimpleDateFormat("dd-MM-yyyy");

util_date1 = sdf.parse(strdate);

sql_date1 =new java.sql.Date(util_date1.getTime());

date = sql_date1;

}

catch ( Exception e )

{

pw.println("Error");

}

try

{

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Connection con =DriverManager.getConnection("jdbc:odbc:TDU","","");

Statement stmt = con.createStatement();

ResultSet rs;

PreparedStatement ps = con.prepareStatement("Insert INTO Flight_Availability(Flt_Id,Flight_Date,Total_Seats,Executive,Economy) VALUES (?,?,?,?,?)");

ps.setString(1,Flt_id);

ps.setDate(2,date);

ps.setString(3,TotalSeats);

ps.setString(4,ExecSeats);

ps.setString(5,EcoSeats);

int check=ps.executeUpdate();

if (check>0)

{

pw.println("Value has been entered into the database.");

}

else

{

pw.println("Error!");

}

ps.close();

con.close();

}// Try ends

catch(SQLException se)

{

pw.println("Database Error : " +se);

}

Thanks a lot for all the help.

[2942 byte] By [DT1a] at [2007-11-26 23:54:33]
# 1

You're throwing away most of the useful information about your error. Replace your catch-block by this:catch(SQLException se)

{

se.printStackTrace();

}

That will tell you what line of code is throwing the exception. If you still need help then ask again. And post the stack trace if you do.

DrClapa at 2007-7-11 15:36:55 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Thanks for responding DrClap,

I tried what you said but that doesn't display anything. Instead when I used what I had orginally done I got this ( which is the original error in question )

java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Optional feature not implemented

Please do help.

Thank you

DT1a at 2007-7-11 15:36:55 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Hi DT1,Please follow DrClap's way to post the stack trace here for us to help you. It's not showing anything because you're looking in the wrong place, you should be looking at the container's log files.
singchyuna at 2007-7-11 15:36:55 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Thanks for the reply. Well I checked that too the container log too is empty. The basic initialisation code is there, but the rest is empty.Im using Tomcat.
DT1a at 2007-7-11 15:36:55 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...