Results 1 to 9 of 9

Thread: Java - Structured Query Language

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Zomosa's Avatar
    Join Date
    Apr 2011
    Location
    Cape Town, South Africa
    Posts
    391

    Default Java - Structured Query Language

    Hello,

    I am coding a small program that will supply the user with synonyms for words entered. I do no want you to code my program for me, I just need some help. I will provide an image to help you understand my problem. I would like to display an error message when the user entered a word that is not in the database.



    Please refer to comment 1, this exception is used when the program fails to execute the Query. The problem is that it only works for certain errors like the incorrect spelling of a field or a missing column that is queried. So I cannot use it for this particular problem, it is only used for certain errors. Please refer to comment 2, the code is used to show me what data is being returned when a word is entered that does not exist. Please refer to comment 3, here I would like to do an if-statement to test whether or not the word has been found or not, if not an appropriate message will be displayed.

    Basically what I need to know is how will Java respond to my query when the entered word is not found? It does not provide an error, only the following : sun.jdbc.odbc.JdbcOdbcR[email protected] (Please refer to my Query just above comment 2)

    My program works fine it just does not provide the user with an error message when a word is entered that does not exist.
    Last edited by Zomosa; 08-08-2011 at 03:31 PM.

  2. #2
    Staple2's Avatar
    Join Date
    Apr 2011
    Location
    Cape Town
    Posts
    460

    Default

    Do your own PAT

    --
    "You think things have to be possible? They have to be true!" - Philip Pullman

  3. #3
    Zomosa's Avatar
    Join Date
    Apr 2011
    Location
    Cape Town, South Africa
    Posts
    391

    Default

    Gaan hou jouself vet om 'n ander plek!

  4. #4
    Staple2's Avatar
    Join Date
    Apr 2011
    Location
    Cape Town
    Posts
    460

    Default

    "[email protected]" is 'n fout algemeen in databasis ondersoeke. Dit kan maklik opgelos word deur gebruik te maak van die lode-metode.

    --
    "You think things have to be possible? They have to be true!" - Philip Pullman

  5. #5
    Zomosa's Avatar
    Join Date
    Apr 2011
    Location
    Cape Town, South Africa
    Posts
    391

    Default

    Wel die probleem is vir elke woord wat ek intik wat nie in die databasis is nie gee hy 'n ander boodskap. So die Lode-Metode gaan nie werk nie! As dit dieselfde resultaat gelewer het kon ek dalk iets gedoen het.

  6. #6
    Staple2's Avatar
    Join Date
    Apr 2011
    Location
    Cape Town
    Posts
    460

    Default

    Noob much. Upload jou screenie in 'n groter size, dink nie enigiemand kan sien wat aangaan nie.

    Maar moet nie my mind nie - ek hijack net jou thread.

    Met pony-pics.


    --
    "You think things have to be possible? They have to be true!" - Philip Pullman

  7. #7
    Zomosa's Avatar
    Join Date
    Apr 2011
    Location
    Cape Town, South Africa
    Posts
    391

    Default

    Dankie baie, maar as hulle right-click en die image view dan kan hulle die image sien. Die forum scale my image vir 'n rede.

  8. #8
    Staple2's Avatar
    Join Date
    Apr 2011
    Location
    Cape Town
    Posts
    460

    Default


    --
    "You think things have to be possible? They have to be true!" - Philip Pullman

  9. #9
    Zomosa's Avatar
    Join Date
    Apr 2011
    Location
    Cape Town, South Africa
    Posts
    391

    Default

    Added some code to fix the problem. Feel free to lock or delete this thread.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •