Results 1 to 5 of 5
  1. #1
    Loop is offline Member
    Join Date
    Sep 2008
    Posts
    36
    Rep Power
    0

    Question Database Project keeps throwing Exceptions.

    Hi, I'm working on a Database project in NetBeans and I'm encountering several
    problems with my application. I use Vectors in one class to store several
    variables which is sent to my JTable in another form. I keep getting several
    exceptions.

    java.sql.SQLException Cannot find driver for jdbc:odbc
    and also a lot of :
    NullPointerExceptions

    Please help, I'm really lost, please request if I need to post code.
    www.talkbinary.com - for anyone that wants to get a new C++ forum on its feet.;)

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    Post the first 5 lines of the exception stack traces. They will contain exact line numbers of where the problem was found in your code. They also give you hints on how to solve those problems.

  3. #3
    Loop is offline Member
    Join Date
    Sep 2008
    Posts
    36
    Rep Power
    0

    Default Yes

    Hey, I was able to fix the problem by redesigning my DatabaseAccess class and at least I'm able to connect with my Database and extract some data now. Only, not all of the things I do actually work.

    Can't seem to be able to a specific something, namely to display all the players that won their games.
    SQL code I used

    String sql = "SELECT ID, Name, Surname, AmountWins, Win/Lose/Draw From TBTournament WHERE Win/Lose/Draw LIKE '0'";
    www.talkbinary.com - for anyone that wants to get a new C++ forum on its feet.;)

  4. #4
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    I doubt if there is any database that will accept the SQL statement you posted above. It may be better to go through the tutorial that came with your DB installation to learn the syntax.

  5. #5
    Loop is offline Member
    Join Date
    Sep 2008
    Posts
    36
    Rep Power
    0

    Default

    Hey, I finally fixed the problem, not only that, when I was able to fix the problem above, I implemented the same idea towards some other sql statements that also moaned. Now everything's working fine! Thanks, I have to admit, after getting the 'too few parameters 1 Expected' exception at least a 100 times, I began to blame it on NetBeans etc... Turns out it was my own human error in my SQL code specifying a Column that did not exist, anyway thanks!
    www.talkbinary.com - for anyone that wants to get a new C++ forum on its feet.;)

Similar Threads

  1. For loops and arrays throwing up errors
    By Banjo in forum New To Java
    Replies: 2
    Last Post: 11-25-2008, 06:40 AM
  2. throwing bug value
    By Dangi in forum New To Java
    Replies: 3
    Last Post: 10-25-2008, 06:14 AM
  3. Display Message Without Throwing Exception
    By kailashchandra in forum JavaServer Faces (JSF)
    Replies: 0
    Last Post: 09-27-2008, 09:05 AM
  4. throwing Exception
    By bugger in forum New To Java
    Replies: 3
    Last Post: 11-09-2007, 09:35 PM
  5. Project of Exceptions
    By Albert in forum Advanced Java
    Replies: 1
    Last Post: 07-06-2007, 03:09 PM

Posting Permissions

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