Solved

applet connect to sql server 2000

Posted on 2002-06-03
10
504 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

636 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