Execute a query with java code

Discussion in 'Software' started by laritta, Aug 19, 2011.

  1. laritta

    laritta

    Joined:
    Aug 15, 2011
    Messages:
    4
    Hi everybody,

    I'm trying to execute a query with java code, when i execute it in mysql server it works but it doesn't with java code.
    I don't know what to do, please guide me :(
    Here is the code i'm using :


    String query = "LOAD DATA LOCAL INFILE 'C:\\Documents and Settings\\input.csv' INTO TABLE trial FIELDS TERMINATED BY ',' IGNORE 2 LINES";

    ResultSet results;

    try{

    Statement stmt = con.createStatement();

    results = stmt.executeQuery(query);​

    stmt.close();
    }

    catch(Exception e){
    System.
    out.println("exception due à la requête");
    }

    }

    }
    laritta, Aug 19, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. john
    Replies:
    2
    Views:
    545
  2. neo_ly24
    Replies:
    1
    Views:
    1,014
    Ivan Ostreš
    Mar 30, 2005
  3. Not Known

    Read & Execute Permissions

    Not Known, Nov 17, 2004, in forum: MCSE
    Replies:
    3
    Views:
    26,995
    The Poster Formerly Known as Kline Sphere
    Nov 19, 2004
  4. richjone@gmail.com

    "can't execute code from a freed script" on webpages

    richjone@gmail.com, May 8, 2007, in forum: Computer Support
    Replies:
    7
    Views:
    3,687
  5. becool_nikks
    Replies:
    0
    Views:
    1,994
    becool_nikks
    Mar 6, 2009
Loading...

Share This Page