Solved

connection to DB from an applet

Posted on 2002-07-22
14
247 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
 
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
noX challenge 17 77
json example 39 115
wordcount challenge 11 78
unix in java example 9 43
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…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
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.

759 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

18 Experts available now in Live!

Get 1:1 Help Now