Discussions
Categories
- 196.9K All Categories
- 2.2K Data
- 239 Big Data Appliance
- 1.9K Data Science
- 450.4K Databases
- 221.7K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 550 MySQL Community Space
- 478 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3K ORDS, SODA & JSON in the Database
- 546 SQLcl
- 4K SQL Developer Data Modeler
- 187K SQL & PL/SQL
- 21.3K SQL Developer
- 295.9K Development
- 17 Developer Projects
- 138 Programming Languages
- 292.6K Development Tools
- 107 DevOps
- 3.1K QA/Testing
- 646K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 155 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.1K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 18 Java Essentials
- 160 Java 8 Questions
- 86K Java Programming
- 80 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 204 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 442 LiveLabs
- 38 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 171 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 232 Portuguese
connecting to remote database(MSSqlserver) using applet

835813
Member Posts: 7
HI, I am having a problem that I have to insert the data in a table from the applet. since the applet run on the client machine and the database is on the remote machine now when java on client machine looks for the driver "com.microsoft.jdbc.sqlserver.SQLServerDriver" then it give the exception that class com.microsoft.jdbc.sqlserver.SQLServerDriver not found. so how should I set the classpath of the jar file mssqlserver.jar so that applet can connect to remote database
Thnaks and Regards
Dilip Agarwal
Thnaks and Regards
Dilip Agarwal
Answers
-
The matter of the driver being on the run-time class-path of the applet, and its ability to connect to 'home' or remote servers is quite different.
The driver will need to be on the class-path for either. To achieve that, add the mssqlserver.jar to the archive attribute of the applet element.
To connect to a DB on a remote server, the applet would also need to be digitally signed (by you) and accepted (by the end user). -
Thanks for you reply,
can you please tell me how to digitally sign the applet -
Hope this help:
<object
classid = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
width = 1 height = 1
name = "Application Web Client"
codebase = "http://java.sun.com/j2se/1.4.1/download.html">
<param name = CODEBASE VALUE = "." >
<param name = ARCHIVE VALUE = "myjar1.jar,
sqljdbc4.jar"
<param name = CODE VALUE = "applet.myapplet.class" >
<param name = NAME VALUE = "Application Web Client" >
<param name = "type" VALUE = "application/x-java-applet;version=1.1" >
<param name = CLIENT_INI VALUE = "client.ini">
</object> -
832171 wrote:Nicely done!
Hope this help:
codebase = "http://java.sun.com/j2se/1.4.1/download.html">
If they gave prizes for worthless advice here, you'd definitely get one. -
..can you please tell me how to digitally sign the appletSee the Generating and Verifying Signatures lesson (http://download.oracle.com/javase/tutorial/security/apisign/index.html) of the Java Tutorial.
-
See also http://stackoverflow.com/questions/4897758/connecting-to-remote-databasemssqlserver-using-applet
-
I suggest you have your applet talk to a servlet. The servlet actually talks to the database (and holds the userID/password). This way, you aren't embedding the userID/password to the database in the applet where someone might get it and have direct access ot your database (a security concern).
I also suggest you review your design to see if separation of concerns might be a better choice (model view controller (MVC) design).
This discussion has been closed.