This discussion is archived
1 2 3 Previous Next 30 Replies Latest reply: Oct 17, 2012 2:28 AM by rukbat Go to original post RSS
  • 15. Re: error handling
    Mihael Pro
    Currently Being Moderated
    Question is quite clear - how to get this info in java program. Sqlplus, sqldeveloper is only examples where it is implemented. If it can't be done by jdbc, suggest other method, please.
  • 16. Re: error handling
    EJP Guru
    Currently Being Moderated
    The answer is also clear, and what SQL Developer does remains irrelevant. You can't get this information unless the vendor's JDBC driver implements it. Your own evidence shows that it doesn't, so it doesn't. Period.
  • 17. Re: error handling
    Mihael Pro
    Currently Being Moderated
    Okay, then any ideas to implement it - other jdbc driver, native methods, etc.
  • 18. Re: error handling
    EJP Guru
    Currently Being Moderated
    Sure. Implement your own SQL parser. But why? You don't need it in an application, you only need it in a developer workbench, and you've already mentioned two of those, so you wouldn't be about to implement another one, would you?
  • 19. Re: error handling
    Mihael Pro
    Currently Being Moderated
    There is no need to parse sql on client, because it can check only syntax errors, privileges checking, existence of objects etc. - is done on database server.
  • 20. Re: error handling
    EJP Guru
    Currently Being Moderated
    I agree completely. However that statement makes your entire question and this entire thread redundant.
  • 21. Re: error handling
    gimbal2 Guru
    Currently Being Moderated
    You can keep trying all you want, but you're not going to get an answer. Do you know why? Because nobody here works on the OJDBC driver. The closed source ODJBC driver I might add. You're asking questions only Oracle engineers can answer; they don't tend to visit the Java forums.

    Now when you have a question about the usage of the JDBC API or another Java programming related topic and not some product specific related questionnaire, feel free to drop in again.
  • 22. Re: error handling
    Mihael Pro
    Currently Being Moderated
    I thought that this question is much easier, because not only Oracle products have this function - PL/SQL Developer from Allround Automations, SQLnavigator from Quest etc.
  • 23. Re: error handling
    EJP Guru
    Currently Being Moderated
    What question? You asked how come SQLPlus was able to give row and column indications on SQL syntax errors. You were told. You asked why JDBC exceptions don't do that. You were told. You asked how to do it yourself. You were told. You didn't like the answer. I agreed. What are you asking now?
  • 24. Re: error handling
    939520 Explorer
    Currently Being Moderated
    Just wondering why you need this functionality. What is the goal of your project? Is it to allow the end user to enter any SQL statement and run it? Or is it just an aid to allow you to develop and try SQL statements more quickly to determine what the problems are?
  • 25. Re: error handling
    Mihael Pro
    Currently Being Moderated
    To write a java-application that execute statements and shows not only ORA- errors, but also the place of query where is a mistake, at line xxx, column xxx.
  • 26. Re: error handling
    Tolls Journeyer
    Currently Being Moderated
    Mihael wrote:
    To write a java-application that execute statements and shows not only ORA- errors, but also the place of query where is a mistake, at line xxx, column xxx.
    Then you'll have to parse the error message that comes back from the database to see if it has line/column information in it.
    As has been said, if the information exists then it will be in the message.
  • 27. Re: error handling
    Mihael Pro
    Currently Being Moderated
    Then you'll have to parse the error message that comes back from the database to see if it has line/column information in it.
    As has been said, if the information exists then it will be in the message.
    This is true only for pl/sql code, for sql statements there is only ORA- error code and message.
  • 28. Re: error handling
    EJP Guru
    Currently Being Moderated
    Exactly, so the information doesn't exist, so if you want it you will have to write your own parser, which is a silly idea, so you don't want to do it. I am mystified by what it is that is mystifying you here.
  • 29. Re: error handling
    Mihael Pro
    Currently Being Moderated
    EJP wrote:
    Exactly, so the information doesn't exist, so if you want it you will have to write your own parser, which is a silly idea, so you don't want to do it. I am mystified by what it is that is mystifying you here.
    Ok, you can remove this thread. Thanks for the help.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points