Link to home
Start Free TrialLog in
Avatar of gilboker
gilbokerFlag for Hong Kong

asked on

connection to DB from an applet

hi.
IM building a chat on the web and i wanted to keep info in some tables and then loop around them to take the data.

my Q is, can i connect to DB by an applet and if so, how?
i connect threw applications with the JDBC driver but it doesent seem to work from an applet.
thanks
Avatar of Mick Barry
Mick Barry
Flag of Australia image

You can certainly connect to a database from an applet in exactly the same way you do from an application.
If you're applet is not signed then you must use either a type 3 or 4 JDBC driver.
Avatar of gilboker

ASKER

well im using JdbcOdbcDriver and i dont know why it doesent connect from the applet after loading to web page.

i have the same example in an application and there it work perfectly
Because it's not a type 3 or 4 driver.
Get yourself a type 3/4 driver and it will work.
Avatar of heyhey_
heyhey_

> Get yourself a type 3/4 driver and it will work.

you probably won't find such driver for Access :)

try MySQL + mmsql jdbc driver

P.S. IMHO using datatbase from applet to implement chat is TERRIBLE design
Type 4 jdbc can connect from an applet, but ONLY by connecting to a database on the machine which served the applet.  
It would be a browser security violation, if an applet
was allowed to open network connections anywhere but back to the server it was launched from.
Type 3/4 drivers for Access exist, they just cost money :)
Have a look at JDataConnect at http://www.j-netdirect.com/ I think they have a single connection license for free.

I agree regards the design decision.
kelfink
Where can i find this type of JDBC bridge(type 4)?
Depends on you DB.
im using MSSql7
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Points r your objects just tell me againcan i use this to conect fro an applet to DB or i have to make security changes?
Sorry i was meaning to say im building a forum not a chat sorry again
Yes you can use it to connect from an applet.
Sorry i was meaning to say im building a forum not a chat sorry again