Solved

connection to DB from an applet

Posted on 2002-07-22
14
251 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: 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 100 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to get all the API from website? 11 131
Weekend adv creator 3 64
Error in @AspectJ Based AOP with Spring 2 24
printf performancy 11 86
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
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 learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This video teaches viewers about errors in exception handling.

696 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