If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

An SQLJ java applet...

ok i need to write an experimental applet code for a student information searcher. THis is what i have, and it sucks. it doesnt work so if anyone can set me inteh right direction....much appreciated.....ty in advance

i don't know about anyone else, but that code is a little unreadable (opened in notepad). Maybe you would be better copying and pasting it into here using the [ CODE ] and [ /CODE ] tags (no spaces though obviously).

Wow

=P

thanx buddy,i know it does. btw i am using an MsAccess db right now (ehhhh) and i would like to change the db type if possible....maybe someone here knows the best kind to use. Also, the mdb is JAVAPROG.mdb if someone could give me suggestions/fix my code it would be very kind.

remember, the BRIDGE is just that.. it joins 2 points.. the JDBC riverbank side and the ODBC riverbank side..

only thing is, you havent built the ODBC riverbank yet.. and nothing you can put in a java program, short of some JNI (java native interface) wizardry, can do it.

you must use the Data Sources (ODBC) control panel to set up a User DSN (data source name)...

on this line:

Code:

url = "jdbcdbc:JAVAPROG";

the following elements are present:

Code:

DRIVERPATH:DATASOURCENAMEjdbc:odbc:JAVAPROG

the driverpath tells the driver manager which driver to use. the data source name specifies where the information comes from.. are you seeing it yet? you wrote JAVAPROG, but what does that mean? where did you actually link the logical name JAVAPROG to an MS access database? :)

...

if u are refering to the JAVAPROG.mdb that resides in the program directory taht i created using the Control Panel > Administrative Tools > Data Sources(ODBC) > User Dsn tab...........then yes, i have created one......... should i say

Code:

jdbc:odbc:JAVAPROG.mdb

?
I did set up a user DSN using the path i specified above...i just cant get my applet to query the database and display the information in the respective fields...would you like me to attach the html file? Im completely stumped as to how I can get my program to successfully query my DB and then take the results from that query and display it.......as far as my simply educated java mind can tell....my program is correct...it no longer gives me the driver error i used to get in my connections field...however after i hit search, nothing happens. I was under the impression that my code would query the DB using SQL syntax in the form of a String, then return the information from the table "info" (that exists in JAVAPROG.mdb) with columns "Fname" "Lname" etc... and (for now) 2 rows; one containing my information for each field and another containing my friends information. Does an MDB use different syntax than SQL does, for example, i query w/

Code:

SELECT Name FROM info WHERE Name = 'Max'

does an MDB use something like

Code:

SELECT FROM info WHERE Name = 'Max'

or something? Im really confused. Am i just retarded and my code is what is wrong? Ty for all your time and knowledge btw cjard i really appreciate it. =)