views:

411

answers:

2

hi!! I have made a small letter game in a Java Applet. I have made a microsoft access database through jdbc for the high scores. I hav managed to insert values(scores) into the database but i hav truble in fetching them and display the table in a textArea of ajFrame. I am not even sure if the connection is established. I hav created the SQL statement for it. please do help me on this cheers!!

A: 

If you've connected successfully then

   connection=DriverManager.getConnection("jdbc:odbc:databaseName");

should return you a connection object and not throw a SqlException.

So I would first check that the above is in fact the case.

Note that an applet can only talk back to its originating server (this is a security feature). So if your applet is served from server A, and your database is on server B, you should get security exceptions.

Brian Agnew
A: 
  1. Check your query with sql prompt.

  2. verify object name used (Drivermanager,Connection,TextField)

  3. Include Exception handling code for sql statements (try and catch )

Paniyar