Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

connection to DB from an applet

Posted on 2002-07-22
14
Medium Priority
?
255 Views
Last Modified: 2010-03-31
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
0
Comment
Question by:gilboker
14 Comments
 
LVL 92

Expert Comment

by:objects
ID: 7170929
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.
0
 
LVL 1

Author Comment

by:gilboker
ID: 7170939
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
0
 
LVL 92

Expert Comment

by:objects
ID: 7170958
Because it's not a type 3 or 4 driver.
Get yourself a type 3/4 driver and it will work.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 16

Expert Comment

by:heyhey_
ID: 7171109
> 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
0
 
LVL 5

Expert Comment

by:kelfink
ID: 7173015
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.
0
 
LVL 92

Expert Comment

by:objects
ID: 7173153
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.
0
 
LVL 1

Author Comment

by:gilboker
ID: 7214478
kelfink
Where can i find this type of JDBC bridge(type 4)?
0
 
LVL 92

Expert Comment

by:objects
ID: 7215904
Depends on you DB.
0
 
LVL 1

Author Comment

by:gilboker
ID: 7216098
im using MSSql7
0
 
LVL 92

Accepted Solution

by:
objects earned 400 total points
ID: 7216109
There's a free one available at www.freetds.org.
0
 
LVL 1

Author Comment

by:gilboker
ID: 7216151
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?
0
 
LVL 1

Author Comment

by:gilboker
ID: 7216193
Sorry i was meaning to say im building a forum not a chat sorry again
0
 
LVL 92

Expert Comment

by:objects
ID: 7216209
Yes you can use it to connect from an applet.
0
 
LVL 1

Author Comment

by:gilboker
ID: 7216232
Sorry i was meaning to say im building a forum not a chat sorry again
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question