Solved

applet connect to sql server 2000

Posted on 2002-06-03
10
503 Views
Last Modified: 2013-12-29
hi,
I am writing an applet which will connect to sql server 2000 using sql server 2000 driver for jdbc.

here is the error msg:
[Microsoft][SQLServer 2000 Driver for JDBC]Unsupported VM encoding MS950.

How can I solve this?
0
Comment
Question by:klnhk
[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
  • 5
  • 2
  • 2
  • +1
10 Comments
 
LVL 9

Expert Comment

by:Ovi
ID: 7050991
Set the encoding of your connection to another type.
Usually you do this by adding after the datasource (database) name the text : charSet=utf-8 for example.
try {
  Class.forName("my.sql.Driver");
} catch(Exception e) {}

String database = "jdbc:...:127.0.0.1/TEST";
String user="TEST";
String password="test";

Connection con = DriverManager.getConnection(database + "?charSet=utf-8", user, password);
0
 

Author Comment

by:klnhk
ID: 7052915
Thanks.

It shows this error this time?

[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Login failed for user 'stanley'.


When I use Applet to connect to SQL, any security problem?
do all uers need to install JDBC in their pc?

0
 
LVL 9

Expert Comment

by:Ovi
ID: 7053114
Are you sure that your user&password are correct? Be aware of case sensitivity. You could try to test all this stuff locally on your computer with a small APPLICATION and see which are the problems raised. If you can connect to the database server from that appliation, convert'it to a simple applet and resolve eventual sequrity problems.
0
Technology Partners: 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!

 

Author Comment

by:klnhk
ID: 7053351
Can an applet in Host A connect to a MS SQL db in Host B?
0
 
LVL 9

Accepted Solution

by:
Ovi earned 100 total points
ID: 7053656
Only if is a signed applet. Normally a applet can connect only to the host from where it comes. If this is your problem you have some solutions :

1. Use signed applet.
2. Delegate the query of the database from the applet to the server. By putting a servlet (cgi, jsp, etc.) on the same server as the applet, get's you the possibility to avoid sequrity problems. The applet only requests then some results from that servlet and displays the results. Also this is a good ideea if you think that a "specialized user" of your applet can capture'it and decompile'it. Since sql statements are holded as strings, will be a quick job to find your table structures, database server, user name&password ... and the rest you can imagine. So, in a word, applets are usually used as "views" of a complex system and should provide simple things, based on forwarding the real work to the server. In this way your applet will be very lite and will load very fast.
0
 
LVL 1

Expert Comment

by:jdc0724
ID: 7068161
Since you are using an applet, I would recommend only passing parameters to a servlet running on a server machine.  Using those parameters you would connect to the database (db2, oracle, access, etc) from within the servlet.  You can then pass the data back to the applet for displaying purposes or whatever?  

If you want to use an applet (because maybe there are many users, etc), then I would definitely use the servlet approach to handle your workload.  Also, since the servlet will acess the databases, only the server in which the servlet resides needs to have JDBC.  Anyone with a browser and the appropriate authority can use the application without having to install JDBC.  

However, if you are the only use of this application I would recommend just creating a Java UI application instead of the Applet/servlet combo.  Keep in mind that JDBC would have to be available on whatever pc you have the application installed.

Good luck,
JDC
0
 
LVL 9

Expert Comment

by:Ovi
ID: 7069174
JDC please read the comment above yours ...
0
 
LVL 9

Expert Comment

by:Ovi
ID: 7069177
KLNHC : I believe it's time to take a decision with this question don't you ?
0
 
LVL 1

Expert Comment

by:jdc0724
ID: 7070036
Ovi, although we have similar comments, I believe we each commented on some of the different benefits of using a server side script to handle the workload.  

Cheers,
JDC
0
 
LVL 35

Expert Comment

by:girionis
ID: 8833938
No comment has been added lately, so it's time to clean up this TA.

I will leave a recommendation in the Cleanup topic area that this question is:

- points to Ovi

Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

girionis
Cleanup Volunteer
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
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:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

752 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