SetDate Error - Optional feature not implemented

Hi I am trying to execute a PreparedStatement to do an insert, I to the best of my knowledge am using it correctly but I still get this ERROR:
java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Optional feature not implementedHere is a code sample:
//SQL Create Table
create table[test]
     [id] int not null identity primary key,
     [name] varchar(30) not null,
--     [date] datetime not null     --Same result with this
     [date] smalldatetime not null
GO
//Java Code
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
public class DataExporter {
    private Connection conn = null;
    private PreparedStatement prep = null;
    public DataExporter() throws Exception{
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            conn = DriverManager.getConnection("jdbc:odbc:MyDatabaseDNSName");
            prep = conn.prepareStatement("INSERT INTO [TEST] ([NAME],[DATE]) VALUES(?,?)");
    public boolean run(String name, java.sql.Date date) throws Exception{
            prep.setString(1, name);
            prep.setDate(2, date);
            return prep.execute();
    public static void main(String[] args) throws Exception{
        DataExporter dExp = new DataExporter();
        java.sql.Date date = new java.sql.Date(System.currentTimeMillis());
        System.out.println("Check Value:\t" + date.toString());
        System.out.println("Result:\t" + dExp.run("Neil", date));
}This is my results:
Check Value:     2008-09-10
Exception in thread "main" java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Optional feature not implemented
        at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6957)
        at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7114)
        at sun.jdbc.odbc.JdbcOdbc.SQLBindInParameterDate(JdbcOdbc.java:808)
        at sun.jdbc.odbc.JdbcOdbcPreparedStatement.setDate(JdbcOdbcPreparedStatement.java:826)
        at DataExporter.run(DataExporter.java:14)
        at DataExporter.main(DataExporter.java:21)
Java Result: 1Can someone please tell me why and how to fix the above to get it to work.(I am using Java 6 and MSSQL 2000)
Thanx in advance

gtRpr wrote:
Thanx yawmark, I will try it.
Just tell me: although I am using Java 6 at home,
I use Java 1.4 at work were I will actually need this,
What is the minimum version of Java that JTDS will work with(1.1, 1.2, 1.3, 1.4, 1.5, 1.6)? [JTDS feature matrix|http://jtds.sourceforge.net/features.html] (from the link I already posted).
~

Similar Messages

  • Error [Microsoft][ODBC Excel Driver]Optional feature not implemented...

    Hi All,
    when i add setAutoCommit(false),
    i got run error [Microsoft][ODBC Excel Driver]Optional feature not implemented.
    i just want to insert data into excel using db.
    can anyone give suggestion??
    here my code:
    public void insertDatabase( ){
                String rule = "fty";
                double weight = 0.245;
               try{
                    String sql = "INSERT INTO [Sheet2$] ( Rule, Weight ) " +
                      "VALUES ( '"+ rule +"', '" + weight + "' )";
                     int row = myStatement.executeUpdate(sql);
                   myConnect.setAutoCommit(false);
                     myResultSetPapar = myStatement.executeQuery("Select * from [Sheet2$]");
                catch(SQLException e){
                            System.out.println(e.getMessage());
               }//catch
           }

    is it true that my driver does not supported??
    my MS Excel version 2002
    and driver vers. 4.0

  • Error when update: Optional feature not implemented

    Hi, all,
    I got the exception: "[Microsoft][ODBC Microsoft Access Driver]Optional feature not implemented" when I use MS Access to update my record.
    I searched the forum, but i couldn't get my answer. I can do select and insert into this table. but i couldn't update it. I am using jdbc-odbc driver. Thanks.
    The code I am using:
    int date = 186;
    String id = "BUF";
    String max = id + "_MX";
    //String min = id + "_MN";
    //String prec = id + "_P";
    query = "update " + tableName + " set " + max + "=? where date=?";
    try {
    ps = con.prepareStatement(query);
    ps.clearParameters();
    ps.setFloat(1, getMax());
    // ps.setFloat(2, getMin());
    // ps.setFloat(3, getPrecip());
    ps.setInt(2, date);
    result = ps.executeUpdate();
    ps.close();
    } catch (SQLException e) {
    System.out.println("Database error, " + e.getMessage());

    Thanks everybody! The problem was solved. I should use setDouble() other than setFloat() method.

  • Getting [Microsoft][ODBC SQL Server Driver] Optional feature not implemented

    I am using below mentioned code to insert values in MSAccess 2000 which having table structure as mentioned below:-
    Field Name Data Type
    TodaysDate Date/Time
    Cart ID Number
    Client Name Text
    Campaign Text
    Team & Segment Text
    Duration Number
    Tape ID Text
    Start Date Date/Time
    End Date Date/Time
    Station Text
    Code:-
    private boolean enterDataIntoMSAccessDatabaseusingPreparedStatement()
       try {
      ps = connection.prepareStatement("INSERT INTO Cart ID Details VALUES (?,?,?,?,?,?,?,?,?)");
      System.out.println("After Query");
       catch (SQLException se) {
      generateErrorMessage("Error in Prepared Statement \n " + se.getMessage() );
       return false;
       catch (Exception e)
      generateErrorMessage("Unexpected Error Occured \n " + e.getMessage());
       String todaysDate = cartIDApplicationAddCartIDDatejTextField.getText().trim();
       String cartID = cartIDApplicationAddCartIDCartIDjTextField.getText().trim();
       String clientName = cartIDApplicationAddCartIDClientNamejTextField.getText().trim();
       String campaign = cartIDApplicationAddCartIDCampaignjTextField.getText().trim();
       String teamSegment = cartIDApplicationAddCartIDTeamAndSegmentjTextField.getText().trim();
       String duration = cartIDApplicationAddCartIDDurationjTextField.getText().trim();
       String tapeID = cartIDApplicationAddCartIDTapeIDjTextField.getText().trim();
       String startDate = cartIDApplicationAddCartIDStartDatejTextField.getText().trim();
       String endDate = cartIDApplicationAddCartIDEndDatejTextField.getText().trim();
       String station = cartIDApplicationAddCartIDDELjCheckBox.getText().substring(0, 3);
      System.out.println(station);
       try {
      System.out.println("Before ps.setString()");
      SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-mm-dd", Locale.ENGLISH);
      System.out.println("Simple Date Format");
       /*ps.setString(1, todaysDate);
      ps.setString(2, cartID );
      ps.setString(3, clientName);
      ps.setString(4, teamSegment);
      ps.setString(5, duration);
      ps.setString(6, tapeID);
      ps.setString(7, startDate);
      ps.setString(8, endDate);*/
      System.out.println("1");
      ps.setDate(1, new java.sql.Date(simpleDateFormat.parse(todaysDate).getTime()));
      ps.setString(2, cartID);
      ps.setString(3, clientName);
      ps.setString(4, campaign);
      ps.setString(5, teamSegment);
      ps.setString(6, duration);
      ps.setString(7, tapeID);
      ps.setDate(8, new java.sql.Date(simpleDateFormat.parse(startDate).getTime()));
      ps.setDate(9, new java.sql.Date(simpleDateFormat.parse(endDate).getTime()));
      ps.setString(10, station);
      System.out.println("After ps.setString()");
      ps.executeUpdate();
       catch (SQLException se) {
      generateErrorMessage("Error while inserting data in database \n " + se.getMessage());
       return false;
       catch (Exception e)
      generateErrorMessage("Unexpected Error Occured \n" + e.getMessage() );
       return true;
    I got below error after implementing the above code:-
    [Microsoft][ODBC SQL Server Driver]Optional feature not implemented.
    Kindly help me for the same.

    >>  [Microsoft][ODBC SQL Server Driver]  
    I don't see anything Oracle in your question.   It looks like you're getting an error using Microsoft's SQL Server driver, did you mean to post this to a forum on  Microsoft's site perhaps?

  • Microsoft][ODBC SQL Server Driver]Optional feature not implemented

    this is my program code for java jdbc:odbc SQL connectivity
    but iam getting the error as
    *java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Optional feature not implemented*
    package desktopapplication2;
    import java.sql.*;
    * @author Bharat Raj Verma
    public class db {
        void get(String gr,String fn,String ln,String job ,Integer rate,Integer ot,String att,long amt,String cmt)
          try
             Connection con=null,con1=null;
            Statement stmt2;
            String query = "Update dbo.attend SET Gr = ? , fn = ? ,ln = ?, job = ? , rate = ? , ot = ? , att = ? ,amt = ? , comment = ?";
           // String query1 = "Select accnum rom dbo.newacc where accnum= ?";
            String url = "jdbc:odbc:bharat";
          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            con = DriverManager.getConnection(url,"","");
            con1 = DriverManager.getConnection(url,"","");
            System.out.println("connection Established");
            stmt2 = con.createStatement();
            Statement stmt = con1.createStatement();
            ResultSet rs;
            rs=stmt.executeQuery("select * from dbo.attend");
            while(rs.next())
                String cmp1= rs.getString("gr");
                if(cmp1.equalsIgnoreCase(gr))
                        PreparedStatement ps1 = con.prepareStatement(query);
                        System.out.println("Insisde RS");
                        ps1.setString(1,gr);
                        ps1.setString(2,fn);
                        ps1.setString(3,ln);
                        ps1.setString(4,job);
                        ps1.setInt(5,rate);
                        ps1.setInt(6,ot);
                        ps1.setString(7,att);
                        ps1.setLong(8,amt);
                        ps1.setString(9,cmt);
                        System.out.println("SSS");
                      //  ps1.setString(1,gr);
                        ps1.executeUpdate();
                       System.out.println("Success");
          catch(Exception e1)
              System.err.println(e1);
    }This is the SQL table in which iam trying to insert the value
    SET ANSI_PADDING OFF
    create table attend
    Gr VARCHAR(20) primary key,
    fn VARCHAR (25),
    ln VARCHAR(25),
    job VARCHAR(25),
    rate integer,
    ot integer,
    att varchar(10),
    amt varchar (10),
    comment varchar(70)
    )the complete output is
    init:
    deps-jar:
    Compiling 1 source file to C:\Documents and Settings\Bharat Raj Verma\My Documents\NetBeansProjects\DesktopApplication2\build\classes
    compile:
    run:
    connection Established
    Insisde RS
    java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Optional feature not implemented
    BUILD SUCCESSFUL (total time: 29 seconds)
    here is the stack trace
    java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Optional feature not implemented
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)
    at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
    at sun.jdbc.odbc.JdbcOdbc.SQLBindInParameterBigint(JdbcOdbc.java:1225)
    at sun.jdbc.odbc.JdbcOdbcPreparedStatement.setLong(JdbcOdbcPreparedStatement.java:592)
    at desktopapplication2.db.get(db.java:47)
    at desktopapplication2.DesktopApplication2View.jButton1ActionPerformed(DesktopApplication2View.java:394)
    at desktopapplication2.DesktopApplication2View.access$800(DesktopApplication2View.java:22)
    at desktopapplication2.DesktopApplication2View$4.actionPerformed(DesktopApplication2View.java:183)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
    at java.awt.Component.processMouseEvent(Component.java:5517)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3135)
    at java.awt.Component.processEvent(Component.java:5282)
    at java.awt.Container.processEvent(Container.java:1966)
    at java.awt.Component.dispatchEventImpl(Component.java:3984)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3819)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
    at java.awt.Container.dispatchEventImpl(Container.java:2010)
    at java.awt.Window.dispatchEventImpl(Window.java:1791)
    at java.awt.Component.dispatchEvent(Component.java:3819)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Plz can anyone help ???

    and what was the solution?
    thanks in advance
    brindy

  • [ODBC SQL Server Driver]Optional feature not implemented

    Hi,
    Has anyone faced such error @ analysis,
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Failed: [nQSError: 16001] ODBC error state: S1C00 code: 0 message: [Microsoft][ODBC SQL Server Driver]Optional feature not implemented. [nQSError: 16012] ODBC error occurred while binding the parameters of a SQL statement. (HY000)
    we are having some issue on DBfeature check box issue.
    Thanks
    Deva

    Hi,
    Yes. after that only i am getting error. if i enabled Query DBMS then report is working with out error (we don't want to use query dbms option that's i just query dbms off option by Reset to default) then its thoewing error.
    Thanks
    Deva

  • Help on "optional feature not implement" exception

    I am trying to use JDBC to update the MS Access table. the SQL is :
    " insert int table1 ([file name],[file description]) values ('DXXCP','RPF PRINT FILE FOR UPDATES');
    By runing this statement, I keep getting "optional feature not implemented" exeption. can any one tell me how to insert this record into Access using JDBC? thanks

    This successfully inserted your strings into an Access database:
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.ResultSetMetaData;
    import java.sql.SQLException;
    public class InsertTest
        public static void main(String [] args)
            try
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                Connection connection = DriverManager.getConnection("jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=InsertTest.mdb");
                String query = "INSERT INTO table1([file name],[file description]) VALUES(?, ?)";
                PreparedStatement statement = connection.prepareStatement(query);
                statement.setString(1, "DXXCP");
                statement.setString(2, "RPF PRINT FILE FOR UPDATES");
                int rowCount = statement.executeUpdate();
                System.out.println(rowCount + " rows affected");
                statement.close();
                connection.close();
            catch (SQLException sqle)
                System.err.println("SQL State: " + sqle.getSQLState());
                System.err.println("SQL Error: " + sqle.getErrorCode());
                sqle.printStackTrace(System.err);
            catch (Exception e)
                e.printStackTrace(System.err);
    }Use PreparedStatement.

  • Optional Feature Not Implemented

    Can anybody tell me the cause of this SQLException -
    Optional Feature Not Implemented ?
    I am getting this exception when i try to make my resultset scrollable -
    nConn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
    or either use PreparedStatement.
    It occurs only when i use MSAccess or SQLServer Database. It doesnot occur with Oracle.
    whats the solution of this ?
    Thanks
    Sonalp

    There are several JDBC drivers for SQL Server, use one that support scrollable resultsets. The JDBC2 standard is made up of one required part and one optional package that the driver manufacturer might implement.
    Microsoft has released (or are about to, it might be beta) a driver of their own that should support scrollable resultsets. You can find it at http://www.microsoft.com/sql/downloads/2000/jdbc.asp
    /Fredrik

  • Optional feature not implemented while using SQL server

    Hi to all
    I am using SQL server.
    I have written a stored procedure in SQL server and it is taking the datetime data type as one parameter.
    I have written the following java code to call that procedure.
    Calendar calendar= Calendar.getInstance();
    cs.setDate(4,new java.sql.Date(calendar.getTime().getTime()));
    cs.execute();
    waiting for reply.
    datetime is the 4th parameter.

    the question has been resolve.the datasource with excel is not schema!

  • Have anyone seen this exception before??? setNull() feature not implemented

    java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Optional feature not implemented
    Have anyone seen this exception before????? I see this exception when I use the "setNull()" function in the preparedstatement class.

    statement.setNull(index, Types.NUMERIC); //works
    statement.setNull(index, Types.DECIMAL); //does not work

  • Mysql show result-- com.mysql.jdbc.NotImplemented: Feature not implemented

    Hello,
    I have set a database and I am trying to show a simple select.I have this code for example:
    String SQL = "SELECT * FROM DatabaseName.tableName";
                         stmt = (Statement) conn.createStatement();
                         rs = (ResultSet) stmt.executeQuery(SQL);
                         while (rs.next()) {
                            System.out.println(rs.getArray(3));
                         }And all I get is an exception:
    com.mysql.jdbc.NotImplemented: Feature not implemented
    at com.mysql.jdbc.ResultSet.getArray(ResultSet.java:1043)
    Is this right?I have tried other methods but I get the above.How to show the result.
    It is in 3rd column double value.

    Are you guys always this cranky? Who's cranky? It's important for the integrity of these forums that misinformation isn't left lying around uncorrected. If that makes you cranky, try elsewhere where the standards may not be so high.
    I posted something that works, now is it exactly as whatever getArray does?No.
    Probably not.Just a minute. You said here that 'the work around code' is something like this, and here that 'it actually is the same result'. You were mistaken. Twice. You are now in the process of changing your mind. Let me help you. It is definitely not exactly what getArray() does. Not even close. Completely different. getArray() gets an array directly from the database from a single column in the current row in the result set. Your code constructs an array from a single column across all rows in the result set. There is no comparison.
    What's wrong with helping outWhat's wrong with getting it right? What's wrong with pointing out an error? What's wrong with admitting when you're mistaken? What's wrong with alerting the OP not to mention all future readers of this thread that it contains misinformation? What's wrong with you finding out that you were wrong?
    and posting what you think it should say
    rather than just being negative?As a matter of fact nobody was 'just negative'. I pointed out exactly what the difference between your code and getArray() is. But by 'negative' do you mean pointing out that you were wrong? Nothing wrong with that.

  • Creative Cloud error message :could not implemented unzip a file on temporarily directory (EX11)I tried many times but it was not working.

    Creative Cloud error message :
    could not implemented unzip a file on temporarily directory (EX11)
    I tried many times but it was not working.

    Nobody can tell you anything without proper system information. Failing extractions can have all sorts of causes. Start with a little system maintenance:
    Installation Preparations | Mylenium's Error Code Database
    Mylenium

  • N91: problem: camera error: general feature not su...

    My camera of my n91  stopped working and  showing error: general feature not supported what should I do I don't think its hardware problem in camera I just taken out and refitted that but what could be d problem can it be software problem.

    Hi dhamot,
    It might be worth you trying to do the following resets:
    Soft Reset:
    Enter into your keypad *#7780# and when prompted, enter the default passcode 12345. If you have changed the code, it will be the code you changed it to.
    A backup will not be needed as this will not delete any data.
    Hard Reset:
    This will erase all data on your device, so a backup is recommended before you do this.
    Once backed up, enter *#7370# and when prompted, enter 12345 as the default passcode.
    Hope this helps, let us know how you get on.
    Regards,
    haZey
    If you find this post helpful, a click upon the white star at bottom would always be appreciated.
    If it also solves your problem, clicking ACCEPT AS SOLUTION below it will benefit other users!

  • Thanks E66 camera error: "Camera: Feature not sup...

    Hi,
    I purchased my E66 a week ago and now I can NOT use my Camera as i'm getting the following error "Camera: Feature not supported". I have not installed any out of the ordinary software!!
    Can someone please let me know how to solve this. Thanks
    Thanks

    Same case with mine...
    After bring to nokia care still have the problem...

  • SetSavepoint()  - Feature Not Implemented

    Hi
    I'm using mySQL (innoDB), jdk 1.4.1 and connectorJ 3.0.8
    (how i get to know the jdbc version)
    Commit and Rollback works, but seting savepoit causes the exception:
    com.mysql.jdbc.NotImplemented: Feature not implemented
         at com.mysql.jdbc.Connection.setSavepoint(Connection.java:780)
    I dont understand wy
    thanks for helping
    Tha Mc

    Feature not implemented:
    Means current JDBC driver you are using does not support this jdbc feature.
    The JDBC API always go advance than all JDBC driver vendor.

Maybe you are looking for