Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

applet connect to sql server 2000

Posted on 2002-06-03
10
Medium Priority
?
507 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
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

Industry Leaders: 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!

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…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
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:
Suggested Courses

971 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