Question:
problem with java database connectivity ?? java expert help needed?
Atul
2008-10-25 13:03:45 UTC
my program have database connectivity,and i have used applet,which on click of button show the content of file(.mdb)

so as to grant permission to my applet i have used the following method

content of file: accs.txt
-------------------------------------------------------------------------------------------------
grant {
permission java.lang.RuntimePermission
"accessClassInPackage.sun.jdbc.odbc";
permission java.util.PropertyPermission
"file.encoding", "read";
};
----------------------------------------------------------------------------------------
and used this command:
appletviewer -J-Djava.security.policy=accs.txt searchtm.java

its working fine and showing output
but what i actually needed my program on web browser so i made html file with following code in it
search.html
--------------------------------------------------------------------------------------------


SEARCH


SEARCH








---------------------------------------------------------------------------
when i open my search.html it shows me the gui
but when i click on button it did not show me the output(i want it for local machine)
how to make it show the output on my search.html file as it was showing in applet by using appletviewer

plzzzz helpp

thanks in advance
Three answers:
Decy Ja
2008-10-25 13:58:22 UTC
Why didn't you specify the code which you use to establish the jdbc connection, and to access and print the database data?



Because of that, I could not answer to your question. But I can give an advice to you. Applet is now old-fashion. No one will use it any more. So you have to learn J2EE web development with Java Servlets and and JSP. When using Java servlets, you can do this very easily.
?
2016-05-29 09:22:35 UTC
I think it's useful when setting up these connections to use a SQL browser which gives you a little bit of help in setting up a connection, so you at least can verify you can get to it from the browser. I use SQuirreL, which works for all of the popular RDBMSs. You'll first have to find the MySql entry in the Drivers list and edit the classpath to include the jar you downloaded. Then, you'll be able to create an alias using that driver. It will give you a little template for creating the JDBC URL. You should be able to figure it out from that. By the way, there's almost never any good reason to set the CLASSPATH environment variable. That is used globally by all Java applications. You're much better off using settings that are specific to your application. How you implement this depends on the kind of application and the environment you're working in.
Anuj
2008-10-25 13:11:26 UTC
u should post ur ans there..

http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi

http://forums.sun.com/index.jspa


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...