Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

applet connect to sql server 2000

Posted on 2002-06-03
10
Medium Priority
?
506 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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 400 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
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 will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
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:
Suggested Courses

719 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