Search Results

Search found 3 results on 1 pages for 'sqlbugs'.

Page 1/1 | 1 

  • Globally Log Catch Exception e

    - by sqlBugs
    Suppose that I have a legacy java application with thousands of lines of code which do: try { // stuff } catch (Exception e) { // eat the exception } Is there any global option that I could flip or 3rd party JAR which would log all "eaten" exceptions? I know that I could do a massive find replace (search for catch (Exception e) { and replace it with catch(Exception e) { logException(e);) but I was wondering if there was a better solution. Thanks!

    Read the article

  • PreparedStatement throws MySQLSyntaxErrorException

    - by sqlBugs
    I have the following Java code: String query = "Select 1 from myTable where name = ? and age = ?"; PreparedStatement stmt = conn.prepareStatement(query); stmt.setString(1, name); stmt.setInt(2, age); ResultSet rs = stmt.executeQuery(); Whenever I run the above code, it throws an exception on line 2 (where the PreparedStatement is declared): Error 0221202: SQLException = com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? AND age = ?' at line 1 Does anyone have any suggestions about what I am doing wrong? Thanks!

    Read the article

  • Java PreparedStatement Throws MySQLSyntaxErrorException

    - by sqlBugs
    I have the following Java code: String query = "Select 1 from myTable where name = ? and age = ?"; PreparedStatement stmt = conn.prepareStatement(query); stmt.setString(1, name); stmt.setInt(2, age); ResultSet rs = stmt.executeQuery(); Whenever I run the above code, it throws an exception on line 2 (where the PreparedStatement is declared): Error 0221202: SQLException = com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? AND age = ?' at line 1 Does anyone have any suggestions about what I am doing wrong? Thanks!

    Read the article

1