#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    2
    Rep Power
    0

    DRIVER doesn't support this function error


    Hi
    I m working on access as the database ana when i tried to execute the following command java throws DRIVER DOESNOT SUPPORT THIS FUNCTION error.... s1 and s2 are
    s1=rs.getString(2);
    s2=rs.getString(3);


    String str5 = "INSERT INTO Result VALUES(s1,s2)";

    CallableStatement cs = con.prepareCall(str5);
    cs.executeUpdate(str5);

    Please help me to solve it...

    i want to use SQl that uses the result of Another SQl...is there any other way??
    the complete code that i m working on is given below

    Statement s= con.createStatement();


    System.out.println("connection Success");
    String query ="select * from trialtable";
    s.execute(query);
    rs=s.getResultSet();
    rs.next();

    // for first item

    s1=rs.getString(2);
    s2=rs.getString(3);

    String str5 = "INSERT INTO Result VALUES(s1,s2)";

    CallableStatement cs = con.prepareCall(str5);
    cs.executeUpdate(str5);
    ...when i print s1 and s2 it prints the string..but wen i try to use s1 and s2 in INSERT INTO Result(table name) VALUES(s1,s2) it throws few more parameters ecpected 1 .......

    Any ideas will be much more helpful for me
  2. #2
  3. Lord of the Dance
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2003
    Posts
    3,540
    Rep Power
    1906
    Can you post the result "DESCRIBE TABLE Result"?
    Which database are you using?

    looking at
    Code:
    rs.getString(2);
    What is rs?

    If it is an ResultSet from another database call, you should try to make the calls into one database call.

    I will suggest you look up SQL injection, especially if rs get the information directly from user input,
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    2
    Rep Power
    0
    hi
    rs is a resultset object.....i have given the complete database code below ...there are two tables ..First one named
    Trialtable ....i m storing the values of trialtable in string objects and trying to use those values as arguments in INSERT table Values(s1,s2).......it doesnot work...



    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    } catch (java.lang.ClassNotFoundException ex) {
    Logger.getLogger(pizza.class.getName()).log(Level.SEVERE, null, ex);
    }



    try {
    con = DriverManager.getConnection("jdbcdbc:temp");
    } catch (SQLException ex) {
    Logger.getLogger(pizza.class.getName()).log(Level.SEVERE, null, ex);
    }


    s= con.createStatement();


    System.out.println("connection Success");
    String query ="select * from trialtable";
    s.execute(query);
    rs=s.getResultSet();
  6. #4
  7. Lord of the Dance
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2003
    Posts
    3,540
    Rep Power
    1906
    You should try not to use SELECT *, but instead name each field you want to extract.

    Can you please be more detailed what you mean with:
    i m storing the values of trialtable in string objects and trying to use those values as arguments in INSERT table Values(s1,s2).......
    and
    it doesnot work...
    Is this related to the issue in your first post?

    It will be easier to help if you post how the tables looks like and some data example of what you have and want.

    Based on the query you have posted, it sounds like you could make one query something like this:
    Code:
    INSERT INTO Result(Val1,Val2) SELECT Val1, Val2 FROM trialtable

IMN logo majestic logo threadwatch logo seochat tools logo