Hello all, I've been working on a project where I wish to retrieve two sets of information from a MySQL database using two prepared statements. When I try to do this I get a blank screen, but the first query is successfull executed. Any suggestion would be greatly appreciated.

Thanks.

....
      String query = "insert into table(stringcol, numcol) values(?, ?)";
      pstmt = conn.prepareStatement(query);
      pstmt.setString(1, "A");
      pstmt.setInt(2, 10);
      pstmt.addBatch();

      pstmt.setString(1, "B");
      pstmt.setInt(2, 2);
      pstmt.addBatch();

      int[] updateCounts = pstmt.executeBatch();
      checkUpdateCounts(updateCounts);
      conn.commit();
      ....

Hello all, I've been working on a project where I wish to retrieve two sets of information from a MySQL database using two prepared statements. When I try to do this I get a blank screen, but the first query is successfull executed. Any suggestion would be greatly appreciated.

Thanks.

Not normal behaviour. If adatapost will not solve it please provide code sample of you using.

I have a question, what if I was trying to work with more than one table?

commented: Try to answer the post. -2

I have a question, what if I was trying to work with more than one table?

It makes no difference to us...

Now, are you gone answer previous question about code you using?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.