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.

Similar Messages

  • 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

  • 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).
    ~

  • 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.

  • 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

  • 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

  • [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

  • 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

  • SQL Exception: Feature not implemented: no detail ???

    I use derby data base v 10.1.1.0
    This exception generated by string results.moveToInsertRow();
    What could it mean?

    That that version derby database does not implement this feature. Is that the latest version of derby?
    http://publib.boulder.ibm.com/infocenter/cscv/v10r1/index.jsp?topic=/com.ibm.cloudscape.doc/rrefexcept16677.html
    Unimplemented aspects of the JDBC driver return an SQLException with a message starting "Feature not implemented" and an SQLState of XJZZZ. These unimplemented parts are for features not supported by Derby.

  • 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.

  • 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.

  • Help with Connections Manipulator not initialized exception

    Hi,
    I have an Enterprise Java Bean that provides an interface to SAP connectors for C++ clients via RMI-IIOP. There is a 'close' method which closes the connection, but when this method is called by the client I am seeing the following exceptions on the J2ee engine: I know that the Connections Manipulator is a J2ee kernel component, and its parameters can be viewed/modified via Visual Administrator, but is there something I need to be doing programmatically to initialize it? Thanks, Colm.
    Cannot get input and output streams from socket. ConnectionsManipulator is not initialized.
    [EXCEPTION]
    iaik.security.ssl.SSLException: Peer sent alert: Alert Fatal: certificate unknown
         at iaik.security.ssl.r.f(Unknown Source)
         at iaik.security.ssl.f.c(Unknown Source)
         at iaik.security.ssl.f.a(Unknown Source)
         at iaik.security.ssl.r.d(Unknown Source)
         at iaik.security.ssl.SSLTransport.startHandshake(Unknown Source)
         at iaik.security.ssl.SSLSocket.startHandshake(Unknown Source)
         at com.sap.engine.services.ssl.factory.SSLSocket.startHandshake(SSLSocket.java:133)
         at com.sap.engine.services.ssl.factory.SSLSocket.getInputStream(SSLSocket.java:247)
         at com.sap.engine.core.manipulator.TCPRunnableConnection.init(TCPRunnableConnection.java:316)
         at com.sap.engine.core.manipulator.TCPRunnableConnection.run(TCPRunnableConnection.java:498)
         at com.sap.engine.frame.core.thread.Task.run(Task.java:60)
         at com.sap.engine.core.thread.impl6.SingleThread.execute(SingleThread.java:73)
         at com.sap.engine.core.thread.impl6.SingleThread.run(SingleThread.java:137)
    Error in resource clean up for a disconnected client
    java.lang.ClassCastException
         at com.sap.engine.services.httpserver.dispatcher.Processor.fail(Processor.java:494)
         at com.sap.engine.core.manipulator.TCPRunnableConnection.disposeConnection(TCPRunnableConnection.java:450)
         at com.sap.engine.core.manipulator.TCPRunnableConnection$CloseThread.run(TCPRunnableConnection.java:838)
         at com.sap.engine.core.manipulator.TCPRunnableConnection.run(TCPRunnableConnection.java:499)
         at com.sap.engine.frame.core.thread.Task.run(Task.java:60)
         at com.sap.engine.core.thread.impl6.SingleThread.execute(SingleThread.java:73)
         at com.sap.engine.core.thread.impl6.SingleThread.run(SingleThread.java:137)

    hello,
    I've got a similar message. What does it mean?
    Complete traces from the dispatcher are:
    ========================================
    Date : 02/15/2007
    Time : 13:17:42:302
    Message : Cannot get input and output streams from socket. ConnectionsManipulator is not initialized.
    [EXCEPTION]
    java.net.SocketException: Connection reset
         at java.net.SocketInputStream.read(SocketInputStream.java:173)
         at iaik.security.ssl.Utils.a(Unknown Source)
         at iaik.security.ssl.o.c(Unknown Source)
         at iaik.security.ssl.r.f(Unknown Source)
         at iaik.security.ssl.f.c(Unknown Source)
         at iaik.security.ssl.f.a(Unknown Source)
         at iaik.security.ssl.r.d(Unknown Source)
         at iaik.security.ssl.SSLTransport.startHandshake(Unknown Source)
         at iaik.security.ssl.SSLSocket.startHandshake(Unknown Source)
         at com.sap.engine.services.ssl.factory.SSLSocket.startHandshake(SSLSocket.java:139)
         at com.sap.engine.services.ssl.factory.SSLSocket.getInputStream(SSLSocket.java:257)
         at com.sap.engine.core.manipulator.TCPRunnableConnection.init(TCPRunnableConnection.java:324)
         at com.sap.engine.core.manipulator.TCPRunnableConnection.run(TCPRunnableConnection.java:524)
         at com.sap.engine.frame.core.thread.Task.run(Task.java:64)
         at com.sap.engine.core.thread.impl6.SingleThread.execute(SingleThread.java:78)
         at com.sap.engine.core.thread.impl6.SingleThread.run(SingleThread.java:148)
    Severity : Error
    Category : /System/Network
    Location : com.sap.engine.core.manipulator.TCPRunnableConnection.init()
    Application :
    Thread : OrderedChannel for http service
    Datasource : 1171548937357:C:\Documents and Settings\defaultTrace.16.trc
    Message ID : 0017087C2A8C00AC000002A70000179B00042982D88AC913
    Source Name : com.sap.engine.core.manipulator.TCPRunnableConnection
    Argument Objs : java.net.SocketException: Connection reset
         at java.net.SocketInputStream.read(SocketInputStream.java:173)
         at iaik.security.ssl.Utils.a(Unknown Source)
         at iaik.security.ssl.o.c(Unknown Source)
         at iaik.security.ssl.r.f(Unknown Source)
         at iaik.security.ssl.f.c(Unknown Source)
         at iaik.security.ssl.f.a(Unknown Source)
         at iaik.security.ssl.r.d(Unknown Source)
         at iaik.security.ssl.SSLTransport.startHandshake(Unknown Source)
         at iaik.security.ssl.SSLSocket.startHandshake(Unknown Source)
         at com.sap.engine.services.ssl.factory.SSLSocket.startHandshake(SSLSocket.java:139)
         at com.sap.engine.services.ssl.factory.SSLSocket.getInputStream(SSLSocket.java:257)
         at com.sap.engine.core.manipulator.TCPRunnableConnection.init(TCPRunnableConnection.java:324)
         at com.sap.engine.core.manipulator.TCPRunnableConnection.run(TCPRunnableConnection.java:524)
         at com.sap.engine.frame.core.thread.Task.run(Task.java:64)
         at com.sap.engine.core.thread.impl6.SingleThread.execute(SingleThread.java:78)
         at com.sap.engine.core.thread.impl6.SingleThread.run(SingleThread.java:148)
    Arguments : java.net.SocketException: Connection reset
         at java.net.SocketInputStream.read(SocketInputStream.java:173)
         at iaik.security.ssl.Utils.a(Unknown Source)
         at iaik.security.ssl.o.c(Unknown Source)
         at iaik.security.ssl.r.f(Unknown Source)
         at iaik.security.ssl.f.c(Unknown Source)
         at iaik.security.ssl.f.a(Unknown Source)
         at iaik.security.ssl.r.d(Unknown Source)
         at iaik.security.ssl.SSLTransport.startHandshake(Unknown Source)
         at iaik.security.ssl.SSLSocket.startHandshake(Unknown Source)
         at com.sap.engine.services.ssl.factory.SSLSocket.startHandshake(SSLSocket.java:139)
         at com.sap.engine.services.ssl.factory.SSLSocket.getInputStream(SSLSocket.java:257)
         at com.sap.engine.core.manipulator.TCPRunnableConnection.init(TCPRunnableConnection.java:324)
         at com.sap.engine.core.manipulator.TCPRunnableConnection.run(TCPRunnableConnection.java:524)
         at com.sap.engine.frame.core.thread.Task.run(Task.java:64)
         at com.sap.engine.core.thread.impl6.SingleThread.execute(SingleThread.java:78)
         at com.sap.engine.core.thread.impl6.SingleThread.run(SingleThread.java:148)
    Dsr Component :
    Dsr Transaction :
    Dsr User :
    Indent : 0
    Level : 0
    Message Code :
    Message Type : 1
    Relatives : /System/Network
    Resource Bundlename :
    Session :
    Source : com.sap.engine.core.manipulator.TCPRunnableConnection
    ThreadObject : OrderedChannel for http service
    Transaction :
    User :
    ========================================
    Thanks,
    H.

  • Never implemented exception handling  in Stored Procedures

    I have lots of stand alone stored procedures callled from .NET 20 programs that follow the following pattern. They runn against Oracle 10.2 on Win2003. The only deviiation is a couple where I insert to temptables. I specify a parameter for messages but don't know the best way to implement for Oracle as well as any tips on ODP.NET/oracle interactions error handling.
    1. Is it recommended to implement exception handling in With Clauses?
    2. If there is an exception in one cursor's SQL, how do I still execute the second?
    3. Is it best in some circumstances to pass a null back to client and check for null in program?
    From .NET programs I have run into a couple of problems.
    4. TNS packet failure.
    Anyways any suggestions or experiences are welcome.
    CREATE OR REPLACE  PROCEDURE   GET_SALES_DATA
                      ,   p_businessdate      in   date                 
                      ,   p_message         out varchar2     
                      ,   p_rcSales             out sys_refcursor
                      ,   p_rInventory            out sys_refcursor
    ) is
    open p_rcSales for
    with somedata as (select ...)
    , someMoreData as (selct ...)
    -- Main select
    Select * from somedata sd inner join somemoredata  smd on smd.key   = sd.key;
    open p_rcInventory for
    with somedata as (select ...)
    , someMoreData as (selct ...)
    -- Main select
    Select * from somedata sd inner join somemoredata  smd on smd.key   = sd.key;
    -- CODE NOT IMPLEMENTED
    -- exception 
    -- when TOO_MANY_ROWS  then  select 'Error handling for future implementations' into p_message from dual ;
    -- when NO_DATA_FOUND  then  select 'Error handling for future implementations. No data'  into p_message from dual;
    -- when others         then  raise_application_error(-20011,'Unknown Exception in GET_SALES_DATA Function');
    -- WHEN invalid_business_date then  select 'Invalid: Business date is in the current work week.' into p_message from dual ;
    END GET_SALES_DATA;Pseudocode'ish because Module level variables and properties have not been defined here for brevity.
    Public Class WebPage1
    PAge_Load
       GetData
    End Class Data Access Layer
    Public Class DAL
    Public Sub GetOracleData()
                Dim conn As OracleConnection
                    Try
                        conn = New OracleConnection
                    Catch ex As Exception
                        Throw ex
                    End Try
                    Dim cmd As New OracleCommand
                    With cmd
                        conn.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings("MyConnectionString").ToString
                        cmd.CommandText = DATABASE.GetSalesData
                        cmd.CommandType = CommandType.StoredProcedure
                        cmd.Connection = conn
                    End With
                    cmd.Connection = conn
                    Dim oparam As OracleParameter
                    oparam = cmd.Parameters.Add("p_businessdate", OracleDbType.Date)
                    oparam.Value = BusinessDate.ToString("dd-MMM-yy")
                    oparam = cmd.Parameters.Add("p_message", OracleDbType.Varchar2, ParameterDirection.Output)
                    oparam = cmd.Parameters.Add("p_rc_inven_csv", OracleDbType.RefCursor, ParameterDirection.Output)
                    oparam = cmd.Parameters.Add("p_rcSales", OracleDbType.RefCursor, ParameterDirection.Output)
                    oparam = cmd.Parameters.Add("p_rcInventory", OracleDbType.RefCursor, ParameterDirection.Output)
                    Dim Adapter As New OracleDataAdapter(cmd)
                    Try
                        Adapter.TableMappings.Add("Table", Sales)
                        Adapter.TableMappings.Add("Table1", Inventory)              
                        Adapter.Fill(dsOracleData)
                    Catch ex As OracleException
                        HandleError("Exception Retrieving Oracle Data", ex, MethodInfo.GetCurrentMethod.Name, True)
                     Finally
                        If conn.State = ConnectionState.Open Then
                            conn.Close()
                        End If
                    End Try
                    dbMessages = cmd.Parameters("p_message").ToString
                End If
                arrStatusMessages.Add("Retrieved Oracle Data Successfully")
            End Sub
           ' Original Implementation ; No longer used
            Public function GetOracleData
               Dim conn As New OracleConnection
                conn.ConnectionString = dbconn.Connectionstring
                 Dim cmd As New OracleCommand
                    With cmd
                        conn.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings("MyConnectionString").ToString
                        cmd.CommandText = DATABASE.GetSalesData
                        cmd.CommandType = CommandType.StoredProcedure
                        cmd.Connection = conn
                    End With
                    cmd.Connection = conn
                    Dim oparam As OracleParameter
                    oparam = cmd.Parameters.Add("p_businessdate", OracleDbType.Date)
                    oparam.Value = BusinessDate.ToString("dd-MMM-yy")
                    oparam = cmd.Parameters.Add("p_message", OracleDbType.Varchar2, ParameterDirection.Output)
                                 oparam = cmd.Parameters.Add("p_rcSales", OracleDbType.RefCursor, ParameterDirection.Output)
                    oparam = cmd.Parameters.Add("p_rcInventory", OracleDbType.RefCursor, ParameterDirection.Output)
                    Dim Adapter As New OracleDataAdapter(cmd)
                    Try
                        Adapter.TableMappings.Add("Table", Sales)
                        Adapter.TableMappings.Add("Table1", Inventory)              
                        Adapter.Fill(dsOracleData)
                    dim dt as datatable = dsoracledata.tables("sales")
                    If IsDataNull(dt) Then
                         _errorType = DBErrorType.NullData
                    End If
                    If isDataEmpty(dt) Then
                         _errorType = DBErrorType.EmptyData
                    End If
                    _hasError = False
                Catch oraEx As OracleException
                      _ExceptionText = oraEx.Message.ToString
                    _errorType = DBErrorType.OracleException
    #If DEBUG Then
                    Throw oraEx
    #End If
                Catch zeroEx As DivideByZeroException
                    _ExceptionText = zeroEx.Message.ToString
                    _errorType = DBErrorType.DivideByZeroException
    #If DEBUG Then
                    Throw zeroEx
    #End If
                Catch oflowEx As OverflowException
                    _ExceptionText = oflowEx.Message.ToString
                    _errorType = DBErrorType.OverflowException
    #If DEBUG Then
                    Throw oflowEx
    #End If
                Catch argEx As InsufficientMemoryException
                    _ExceptionText = argEx.Message.ToString
                    _errorType = DBErrorType.InsufficientMemoryException
    #If DEBUG Then
                    Throw argEx
    #End If
                Catch nomemEx As OutOfMemoryException
                    _ExceptionText = nomemEx.Message.ToString
                    _errorType = DBErrorType.OutOfMemoryException
    #If DEBUG Then
                    Throw nomemEx
    #End If
                Catch Ex As Exception
                    _ExceptionText = Ex.Message.ToString
                    _errorType = DBErrorType.GenericException
    #If DEBUG Then
                    Throw Ex
    #End If
                Finally
                    If conn.State = ConnectionState.Open Then
                        conn.Close()
                    End If
                End Try
    End class Error Class
    Public Class Errors
           Public Sub ExitClass()
                Return
            End Sub
            ' 'blnWriteNow says when Error is critical and no further processing needs to be done by class, then write to event logs or text files and call exit class
            '  to return control back to webpage. This is my first time trying this way.
            Public Sub HandleError(ByVal friendlyMsg As String, ByVal objEx As Exception, ByVal methodInfo As String, Optional ByVal blnWriteNow As Boolean = False)
                If Not blnWriteNow Then Exit Sub
                Dim strMessages As String
                strMessages = arrStatusMessages
                'Send error email
                If  blnSendEmails Then
                     SendMail("[email protected],  strMessages. applicationname, " has thrown  error. ")
                End If
              'Throw error for   debugging
                If  blnThrowErrors Then  
                            Throw New Exception(strMessages & vbCrLf & objEx.Message)
                End If
               ' Write to event log and if not available (shared hosting environment), write to text log
                If blnWriteNow Then
                    If  blnWriteToEvtLog Then
                        If  blnCanWriteToEvtLog Then    'Program has write permission to log
                             WriteToEventLog(strMessages, _appname, EventLogEntryType.Error,  appname)
                        Else
                            If Not Directory.Exists( appPath & "\log") Then
                                Try
                                    Directory.CreateDirectory( appPath & "\log")
                                Catch ex As Exception
                                    arrStatusMessages.Add("Cant't write to event log or create a directory")
                                End Try
                            End If
                        End If
                    End If
                End If          
            End Sub
    End Class

    I have lots of stand alone stored procedures callled from .NET 20 programs that follow the following pattern. They runn against Oracle 10.2 on Win2003. The only deviiation is a couple where I insert to temptables. I specify a parameter for messages but don't know the best way to implement for Oracle as well as any tips on ODP.NET/oracle interactions error handling.
    1. Is it recommended to implement exception handling in With Clauses?
    2. If there is an exception in one cursor's SQL, how do I still execute the second?
    3. Is it best in some circumstances to pass a null back to client and check for null in program?
    From .NET programs I have run into a couple of problems.
    4. TNS packet failure.
    Anyways any suggestions or experiences are welcome.
    CREATE OR REPLACE  PROCEDURE   GET_SALES_DATA
                      ,   p_businessdate      in   date                 
                      ,   p_message         out varchar2     
                      ,   p_rcSales             out sys_refcursor
                      ,   p_rInventory            out sys_refcursor
    ) is
    open p_rcSales for
    with somedata as (select ...)
    , someMoreData as (selct ...)
    -- Main select
    Select * from somedata sd inner join somemoredata  smd on smd.key   = sd.key;
    open p_rcInventory for
    with somedata as (select ...)
    , someMoreData as (selct ...)
    -- Main select
    Select * from somedata sd inner join somemoredata  smd on smd.key   = sd.key;
    -- CODE NOT IMPLEMENTED
    -- exception 
    -- when TOO_MANY_ROWS  then  select 'Error handling for future implementations' into p_message from dual ;
    -- when NO_DATA_FOUND  then  select 'Error handling for future implementations. No data'  into p_message from dual;
    -- when others         then  raise_application_error(-20011,'Unknown Exception in GET_SALES_DATA Function');
    -- WHEN invalid_business_date then  select 'Invalid: Business date is in the current work week.' into p_message from dual ;
    END GET_SALES_DATA;Pseudocode'ish because Module level variables and properties have not been defined here for brevity.
    Public Class WebPage1
    PAge_Load
       GetData
    End Class Data Access Layer
    Public Class DAL
    Public Sub GetOracleData()
                Dim conn As OracleConnection
                    Try
                        conn = New OracleConnection
                    Catch ex As Exception
                        Throw ex
                    End Try
                    Dim cmd As New OracleCommand
                    With cmd
                        conn.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings("MyConnectionString").ToString
                        cmd.CommandText = DATABASE.GetSalesData
                        cmd.CommandType = CommandType.StoredProcedure
                        cmd.Connection = conn
                    End With
                    cmd.Connection = conn
                    Dim oparam As OracleParameter
                    oparam = cmd.Parameters.Add("p_businessdate", OracleDbType.Date)
                    oparam.Value = BusinessDate.ToString("dd-MMM-yy")
                    oparam = cmd.Parameters.Add("p_message", OracleDbType.Varchar2, ParameterDirection.Output)
                    oparam = cmd.Parameters.Add("p_rc_inven_csv", OracleDbType.RefCursor, ParameterDirection.Output)
                    oparam = cmd.Parameters.Add("p_rcSales", OracleDbType.RefCursor, ParameterDirection.Output)
                    oparam = cmd.Parameters.Add("p_rcInventory", OracleDbType.RefCursor, ParameterDirection.Output)
                    Dim Adapter As New OracleDataAdapter(cmd)
                    Try
                        Adapter.TableMappings.Add("Table", Sales)
                        Adapter.TableMappings.Add("Table1", Inventory)              
                        Adapter.Fill(dsOracleData)
                    Catch ex As OracleException
                        HandleError("Exception Retrieving Oracle Data", ex, MethodInfo.GetCurrentMethod.Name, True)
                     Finally
                        If conn.State = ConnectionState.Open Then
                            conn.Close()
                        End If
                    End Try
                    dbMessages = cmd.Parameters("p_message").ToString
                End If
                arrStatusMessages.Add("Retrieved Oracle Data Successfully")
            End Sub
           ' Original Implementation ; No longer used
            Public function GetOracleData
               Dim conn As New OracleConnection
                conn.ConnectionString = dbconn.Connectionstring
                 Dim cmd As New OracleCommand
                    With cmd
                        conn.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings("MyConnectionString").ToString
                        cmd.CommandText = DATABASE.GetSalesData
                        cmd.CommandType = CommandType.StoredProcedure
                        cmd.Connection = conn
                    End With
                    cmd.Connection = conn
                    Dim oparam As OracleParameter
                    oparam = cmd.Parameters.Add("p_businessdate", OracleDbType.Date)
                    oparam.Value = BusinessDate.ToString("dd-MMM-yy")
                    oparam = cmd.Parameters.Add("p_message", OracleDbType.Varchar2, ParameterDirection.Output)
                                 oparam = cmd.Parameters.Add("p_rcSales", OracleDbType.RefCursor, ParameterDirection.Output)
                    oparam = cmd.Parameters.Add("p_rcInventory", OracleDbType.RefCursor, ParameterDirection.Output)
                    Dim Adapter As New OracleDataAdapter(cmd)
                    Try
                        Adapter.TableMappings.Add("Table", Sales)
                        Adapter.TableMappings.Add("Table1", Inventory)              
                        Adapter.Fill(dsOracleData)
                    dim dt as datatable = dsoracledata.tables("sales")
                    If IsDataNull(dt) Then
                         _errorType = DBErrorType.NullData
                    End If
                    If isDataEmpty(dt) Then
                         _errorType = DBErrorType.EmptyData
                    End If
                    _hasError = False
                Catch oraEx As OracleException
                      _ExceptionText = oraEx.Message.ToString
                    _errorType = DBErrorType.OracleException
    #If DEBUG Then
                    Throw oraEx
    #End If
                Catch zeroEx As DivideByZeroException
                    _ExceptionText = zeroEx.Message.ToString
                    _errorType = DBErrorType.DivideByZeroException
    #If DEBUG Then
                    Throw zeroEx
    #End If
                Catch oflowEx As OverflowException
                    _ExceptionText = oflowEx.Message.ToString
                    _errorType = DBErrorType.OverflowException
    #If DEBUG Then
                    Throw oflowEx
    #End If
                Catch argEx As InsufficientMemoryException
                    _ExceptionText = argEx.Message.ToString
                    _errorType = DBErrorType.InsufficientMemoryException
    #If DEBUG Then
                    Throw argEx
    #End If
                Catch nomemEx As OutOfMemoryException
                    _ExceptionText = nomemEx.Message.ToString
                    _errorType = DBErrorType.OutOfMemoryException
    #If DEBUG Then
                    Throw nomemEx
    #End If
                Catch Ex As Exception
                    _ExceptionText = Ex.Message.ToString
                    _errorType = DBErrorType.GenericException
    #If DEBUG Then
                    Throw Ex
    #End If
                Finally
                    If conn.State = ConnectionState.Open Then
                        conn.Close()
                    End If
                End Try
    End class Error Class
    Public Class Errors
           Public Sub ExitClass()
                Return
            End Sub
            ' 'blnWriteNow says when Error is critical and no further processing needs to be done by class, then write to event logs or text files and call exit class
            '  to return control back to webpage. This is my first time trying this way.
            Public Sub HandleError(ByVal friendlyMsg As String, ByVal objEx As Exception, ByVal methodInfo As String, Optional ByVal blnWriteNow As Boolean = False)
                If Not blnWriteNow Then Exit Sub
                Dim strMessages As String
                strMessages = arrStatusMessages
                'Send error email
                If  blnSendEmails Then
                     SendMail("[email protected],  strMessages. applicationname, " has thrown  error. ")
                End If
              'Throw error for   debugging
                If  blnThrowErrors Then  
                            Throw New Exception(strMessages & vbCrLf & objEx.Message)
                End If
               ' Write to event log and if not available (shared hosting environment), write to text log
                If blnWriteNow Then
                    If  blnWriteToEvtLog Then
                        If  blnCanWriteToEvtLog Then    'Program has write permission to log
                             WriteToEventLog(strMessages, _appname, EventLogEntryType.Error,  appname)
                        Else
                            If Not Directory.Exists( appPath & "\log") Then
                                Try
                                    Directory.CreateDirectory( appPath & "\log")
                                Catch ex As Exception
                                    arrStatusMessages.Add("Cant't write to event log or create a directory")
                                End Try
                            End If
                        End If
                    End If
                End If          
            End Sub
    End Class

Maybe you are looking for