participate


Java Programming - Microsoft][ODBC SQL Server Driver]Optional feature not implemented
This question is answered.

<<   Back to Forum  |   Give us Feedback
5 Duke Stars available
This topic has 2 replies on 1 page.
Bhararrajverma
Posts:16
Registered: 7/24/08
Microsoft][ODBC SQL Server Driver]Optional feature not implemented   
2008/08/04 6:56
 
 
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 ???
 
Bhararrajverma
Posts:16
Registered: 7/24/08
Re: Microsoft][ODBC SQL Server Driver]Optional feature not implemented   
2008/08/04 7:07 (reply 1 of 2)  (In reply to original post )
 
 
solved myself

sorry for inconvinience
 
brindy
Posts:5
Registered: 08/03/05
Re: Microsoft][ODBC SQL Server Driver]Optional feature not implemented   
2008/09/30 9:06 (reply 2 of 2)  (In reply to #1 )
 
 
and what was the solution?

thanks in advance
brindy
 
This topic has 2 replies on 1 page.
Back to Forum
 
Read the Developer Forums Code of Conduct

Click to email this message Email this Topic

Edit this Topic
  
 
Forums Statistics

About Sun forums
  • Sun Forums is a large collection of user generated discussions. It is here to help you ask questions, find answers, and participate in discussions.

    Check out our guide on Getting started with Sun Forums for a full walkthrough of how to best leverage the benefits of this community.

Powered by Jive Forums