Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: i m finding an exception " opeartion must use an updateable query"

  1. #1
    Junior Member
    Join Date
    May 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default i m finding an exception " opeartion must use an updateable query"

    public class   p {
     
        public static void main(String[] args) {
     
            try {
     
                       Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                       Connection con = DriverManager.getConnection("jdbc:odbc:worcester");
                       Statement st = con.createStatement();
     
     
                      //ResultSet rs1 = st.executeQuery("Select * from [sheet1$]");
                     //  while(rs1.next())
                      //  {
                      // }
                         String s1="insert into [sheet1$] values('meena.java','5','null','null','null')";
                        st.executeUpdate(s1);
     
     
     
                st.close();
                con.close();
     
            } 
                catch (Exception ex) {
                                       System.err.print("Exception: ");
                                      System.err.println(ex.getMessage());
                                     }
        }
    Last edited by copeg; May 2nd, 2011 at 09:00 AM.


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,297
    Thanks
    180
    Thanked 824 Times in 767 Posts
    Blog Entries
    5

    Default Re: i m finding an exception " opeartion must use an updateable query"

    Try using Statement.execute("my insert statement")

Similar Threads

  1. Exception in thread "main" java.lang.NullPointerException
    By MryJaho in forum What's Wrong With My Code?
    Replies: 4
    Last Post: February 4th, 2011, 04:36 PM
  2. Replies: 6
    Last Post: November 12th, 2010, 03:40 AM
  3. Replies: 16
    Last Post: August 27th, 2010, 03:30 PM
  4. "java.lang.NoSuchMethodError: main" and "fatal exception occured."
    By joachim89 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: January 10th, 2010, 07:35 AM
  5. Replies: 1
    Last Post: October 25th, 2009, 11:54 AM

Tags for this Thread