geting data from multiple table when selecting a row then clicking a button

后端 未结 1 1062
有刺的猬
有刺的猬 2021-01-27 19:58

I am try to run the code below but every time I run it, it don\'t work. Could any one please highlight what i am doing wrong?

What the code should do is:

I have

相关标签:
1条回答
  • 2021-01-27 20:15

    First of all give your tables proper names. "r" and "sa" don't mean anything.

    I don't know what the problem with your SQL is but I will suggest that you use a PreparedStatement. It makes it easier to code the SQL so you don't worry about delimiter type mistakes.

    A basic example would be:

    String sql = "INSERT INTO Page (Name, Title) VALUES (?, ?)";
    
    PreparedStatement stmt = connection.prepareStatement(sql);
    
    stmt.setString( 1, "Name1" );
    stmt.setString( 2, "Title1" );
    stmt.executeUpdate();
    

    You can search the forum or web for more information.

    0 讨论(0)
提交回复
热议问题