• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

error during batch update

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello friends
i am getting unsupportedoperation exception when i run this
program
import java.sql.*;
public class batch
{

public static void main(String arg[])
{
Connection conn=null;
ResultSet rs=null;
Statement stmt=null;
ResultSetMetaData rsmd=null;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn=DriverManager.getConnection("jdbc dbc:rst");
stmt=conn.createStatement();

conn.setAutoCommit(false);

stmt.addBatch("INSERT INTO student " +
"VALUES('Amaretto', 49, 'm')");
stmt.addBatch("INSERT INTO student " +
"VALUES('Hazelnut', 49,'m' )");
stmt.addBatch("INSERT INTO student " +
"VALUES('Amaretto_decaf', 49,'m')");
stmt.addBatch("INSERT INTO student " +
"VALUES('Hazelnut_decaf', 49,'m')");
int [] updateCounts = stmt.executeBatch();
System.out.println("inserted");
}
catch(ClassNotFoundException e){}
catch(SQLException sq){}
}
}
there is no error but operation not supported.what to do
pl help me in this
thanks for all
bye
baskar
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your JDBC (or maybe ODBC) driver does not support one or more of the features you're trying to use. The line number quoted in the exception stack trace will tell you exactly which statement causes the exception and thereby which operation is not supported.
- Peter
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Make sure Your are Using JDBC 2.0 version Api supported Driver .
 
karai baskar
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
yes i am using jdbc2.0 api supported driver.
i get the exception when the first statement
st.addBatch( ) gets executed.
bye
baskar
 
Peter den Haan
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by karai baskar:
yes i am using jdbc2.0 api supported driver.


Are you sure? The JDK1.2 bridge did not support it. The JDK1.3 one does -- at least, according to the documentation.
- Peter

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic