Solved

connection to DB from an applet

Posted on 2002-07-22
14
249 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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 tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

815 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now