Problem in connect database using applet

hi
please
i want open database in page html with use Applet
i use this code but database not work in the my page
if this code have problem
please correct this code to open database in page html
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection(
"jdbc:odbc:DRIVER=Microsoft Access Driver (*.mdb);DBQ=C:\\hwzyfa.mdb ");
sta = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE);
res = sta.executeQuery("select * from aha");
this is my code
package orcle;
import java.sql.*;
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
<applet code="test.class" width=200 height=200>
</applet>
public class Applora extends Applet implements ActionListener
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
String str=null;
TextArea ta;
public void init()
ta= new TextArea(10,30);
add(ta);
Button b1 = new Button(">>");
add(b1);
b1.addActionListener(this);
ta.setText("Initialization...\n");
public void start() {java.applet.AudioClip a=  Applet.newAudioClip(Applora.class.getResource("a.mid"));
   a.play();
public void actionPerformed(ActionEvent ae)
ta.appendText("Inside actionPerformed\n");
try
ta.appendText("Inside try block\n");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
ta.appendText("Class loaded\n");
/********** upto this point it works fine **************/
con=DriverManager.getConnection("jdbc:odbc:DRIVER=Microsoft Access Driver (*.mdb);DBQ=C:\\hwzyfa.mdb ");
ta.appendText("Connection created\n");
stmt=con.createStatement();
ta.appendText("Statement created\n");
rs=stmt.executeQuery("select * from aha");
ta.appendText("Resultset created\n");
while(rs.next())
str=str+rs.getString(2)+" "+"\n";
//str=str+rs.getString(2)+" "+"\n";
ta.appendText(str);
con.close();
stmt.close();
rs.close();
}catch(ClassNotFoundException cnfe){System.out.println("Class Not found "+cnfe.getMessage());}
catch(SQLException sqle){System.out.println("SQL Exception "+sqle.getMessage());ta.setText(sqle.getMessage());}
catch(Exception e){ta.setText(e.getMessage());e.getMessage();}
}

i want access to database in page html with use AppletFirst of all, that doesn't make any sence, if it's a single user application make it a java
application.
If it's a multu user application make it a client server where the web server connects to
the database when the client requests a connection.
When the applet connects to the database any client running the applet needs a
connection to your database server, the client needs the jdbc drivers and the client's
jre needs to find them (set classpath with runtime parameters or set the classes in
javadir lib). After that the client needs to change thiere java.policy or you need to sign
the applet.
Needless to say that's a lot of trouble. And if you go through all that trouble the client
can de-compile your applet and see the connection to the database server and the
server name. Now the client can destroy your database or worse see date it is not
supposed to see.
Since you are a brainless ... who needed to post this question 6 times did not respond to any of my post in your other threads I can just say good luck with your problem.

Similar Messages

  • Problem to connect database from Developer 6i

    I have downloaded Developer 6i from oracle.com
    before that, I have already downloaded 9i database default_home directory is c:\orant.
    while i was installing develper 6i it was installed with forms_home, c:\orant\forms.
    I was using the forms builder to design forms but while i was trying to connect to database it is saying that "Unable to Connect to Destination"
    i was using scott/tiger.
    this time i have tried scott/tiger@rkmurari...(rkmurari is SID and Database name).
    Can anybody help me in solving this problem..
    Thank you very much..

    I have a problem to connect database from developer 6i

  • Connect database using ext javascript or applescipt in indesign

    Hi,
    I need to connect oracle database using extended javascript or apple script in indesign. Can somebody help by giving any suggestion. Or is there any possibility to connect database using the two scripting methods.
    It  is really urgent.
    Thanks
    Karthik B

    ExtendScript has a Socket object prototype you can use to e.g. connect to the internet. Calling a web service would probably be more elegant than addressing the database directly. Socket is fairly low-level, though. If you need something easier, you could always try out http://extendables.org/docs/packages/http/doc/readme.html
    I seem to recall some InDesign plug-ins you could buy that allow you to connect to a database directly, but you'd have to google that yourself.

  • How to connect database using coding in trigger in forms

    Oracle forms6i
    Hai All
    Is there any possiblity to connect database using coding.
    For example when we open a form and we use some button and write some coding and when we execute a small will appear and we give username,connection identifier and database name.
    Is it any possible there when we create a button and in that button we write coding our database name,connectionid and user and when we exe it will internally connect database Pls tell me..
    Regards
    Srikkanth.M

    use LOGON Procedure
    PROCEDURE LOGON
      (username  VARCHAR2,
       password  VARCHAR2);
    logon('scott','tiger@orcl');Mr.Srikkanth.M if u dont close ur old questions dont expect others to answer ur question everytime......so plz remember if u think the person's answer is helpful or correct mark it accordingly
    Thanks :)
    Baig
    [My Oracle Blog|http://baigsorcl.blogspot.com/]

  • Is it possible to connect database using session bean

    Dear all,
    Is it possible to connect database using session bean without using entity beans like cmp,bmp.
    if ur answer is yes, then pls tell me where to put the select statement and transaction attribute like(6 types).
    if u have sample code, then it is good for me.
    Hope I will get answer.

    Sure it is.
    Try something like this (and maybe get a book on JDBC):
    String name;
    try {
         InitialContext ic = new InitialContext();
         DataSource ds = (DataSource) ic.lookup(Constants.MY_DATASOURCE);
         Connection connection = ds.getConnection();
         String sql = "SELECT * FROM TABLE";
         PreparedStatement statement = connection.prepareStatement(sql);
         ResultSet rs = statement.executeQuery();
         while (rs.next()) {
              name = rs.getString("NAME");
         if (rs != null)
              rs.close();
         if (statement != null)
              statement.close();
         if (connection != null)
              connection.close();
    catch (NamingException e) {
         // Can't get JDBC datasource
         // ... do something with this exception
    catch (SQLException e) {
         // SQL exception from getter
         // .... do seomthing with this one too
    }

  • How to access remote database using applet

    hi all,
    I want to know how to access remote database using applet,
    Please help me anybody.
    Regards
    Jesu

    If the database is on a public server, you probably can't access it directly (security wise). You can make your applet talk to a server-side application, which makes the database calls on behalf of the applet. But even in an intranet environment this setup is often preferable, because you don't need to distribute a JDBC driver to all your clients.

  • Problem in connecting Database by using SQL Developer

    Hi,
    I recently installed SQL Developer after installing Oracle 10g and am trying to connect existing database. could anybody help me to connect and what credential should i required to connect.
    Thanks in advance
    LN Reddy

    I am new to oracle myself, so I apologize if this information is not helpful. But I have a number of connections to a local database on my laptop. The way that I connected is using the 'Basic' tab with the following settings:
    Hostname: localhost
    Port: 1521
    SID: orcl
    And of course the username above.
    I hope that might be helpful.

  • Fail to connect database using UNC path

    I have encoutered problem to connect sample database which is located at share drive such as J: drive.
    I setup up the environment at follow:
    The database is save at J: drive such as J:\xtreme.mdb
    I use crystal report 2008 to create report template and the database location is J:\xtreme.mdb
    [http://i105.photobucket.com/albums/m229/kenkit/diagram1.jpg]
    Then, I published the report into CRS2008. While I preview the report. I got the error message
    "The database logon information for this report is either incomplete or incorrect. "
    The report database configuration is at below:

    crosspost

  • Fail to connect database using network drive

    I have encoutered problem to connect sample database which is located at share drive such as J: drive.
    I setup up the environment at follow:
    The database is save at J: drive such as J:\xtreme.mdb
    I use crystal report 2008 to create report template with sample database which is location at J:\xtreme.mdb
    [http://i105.photobucket.com/albums/m229/kenkit/diagram1.jpg]
    Then, I published the report into CRS2008. While I preview the report. I got the error message
    "The database logon information for this report is either incomplete or incorrect. "
    I am successful to map the network drive and open it.
    [http://i105.photobucket.com/albums/m229/kenkit/picture5.jpg]
    The report database configuration at CRS2008 is at below:
    [http://i105.photobucket.com/albums/m229/kenkit/picture2.jpg]
    [http://i105.photobucket.com/albums/m229/kenkit/picture3.jpg]
    In addition, I had already started SIA service with domain administrator account.
    [http://i105.photobucket.com/albums/m229/kenkit/picture4.jpg]
    So, anybody can give idea or suggestion to solve this problem?
    Edited by: Ken Hui on Apr 21, 2011 5:37 AM
    Edited by: Ken Hui on Apr 21, 2011 5:50 AM

    crosspost

  • How to connect database using JSF??

    When I deployed a JSF war file which was connected to MySql on Sun Application Server, then lanuched it, why there was an error message like "HTTP Status 503 - This application is not currently available". Can anyone tell me why? thanks.

    Thanks pringi~~!!
    I still have problems about the database connection. I had tried many examples which were provided by some books. However, once I deployed the application, it still got problems. Can anyone help me and provide a example about the database connection. Thanks a lot.

  • How to Connect Database Using Script?

    Hi all,
                    Am using Adobe InDesign CS3. Is there any way to connect database from Adobe InDesign CS3 Scripting (Javascript)? Thanks in advance.
    Regards,
    Mohan

    I don't know javascript so I can't help with that part.
    The system plug in you need is from Actual Technologies : http://www.actualtechnologies.com/ The setup for that is detailed in their instructions. You will probably want to set it up for system-wide access, not by user. I found system-wide access more reliable, fwiw.
    For Applescript I send a command through the Terminal/command line that returns the data from the query.
    Here is Applescript:
    set query to "YOUR DB QUERY"
    set results to (do shell script "echo \"" & query & "\" | iodbctest \"dsn=" & dsn & ";uid=" & uid & ";pwd=" & pwd & "\" | awk '{ if (match($0,\"SQL>\")) {k++; if (k==1) next; if (k==2) exit; } if (k==1) print; }'")
    You can probably do something similar in Javascript. You'll have to parse out the text data returned then. I think there may be plug-ins for InDesign that can directly connect to a database (?). Or some plug-ins like inData can take their data passed from a script as well.
    Chris

  • Problem creating standby database using RMAN

    I am preparing standby database on Windows environment. For the same..
    1. I have taken full database,archivelog and standby control file backup on primary database.
    2.Backup pieces have been moved to standby server.
    3.TNS configured on both the servers.
    4.connected to target as well as auxiliary database and trying to create the standby database using the below command...
    duplicate target database for standby;
    But I am getting the below error........
    channel ORA_AUX_DISK_1: starting datafile backupset restore
    channel ORA_AUX_DISK_1: restoring control file
    channel ORA_AUX_DISK_1: reading from backup piece E:\BACKUP\STNDBY_CF_AIRPRIM_T690931864_S25_P1
    ORA-19870: error reading backup piece E:\BACKUP\STNDBY_CF_AIRPRIM_T690931864_S25_P1
    ORA-19504: failed to create file "E:\ORACLE\PRODUCT\10.2.0\ORADATA\AIRPRIM\CONTROL01.CTL"
    ORA-27040: file create error, unable to create file
    OSD-04002: unable to open file
    O/S-Error: (OS 3) The system cannot find the path specified.
    failover to previous backup
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of Duplicate Db command at 07/01/2009 10:35:48
    RMAN-03015: error occurred in stored script Memory Script
    RMAN-06026: some targets not found - aborting restore
    RMAN-06024: no backup or copy of the control file found to restore
    Please provide me the solution for the same...
    Thanks in Advance.....
    Sukanta

    channel ORA_AUX_DISK_1: reading from backup piece E:\BACKUP\STNDBY_CF_AIRPRIM_T690931864_S25_P1
    ORA-19870: error reading backup piece E:\BACKUP\STNDBY_CF_AIRPRIM_T690931864_S25_P1
    ORA-19504: failed to create file "E:\ORACLE\PRODUCT\10.2.0\ORADATA\AIRPRIM\CONTROL01.CTL"
    ORA-27040: file create error, unable to create file
    OSD-04002: unable to open file
    O/S-Error: (OS 3) The system cannot find the path specified.
    failover to previous backup
    Can you please confirm if the directory E:\ORACLE\PRODUCT\10.2.0\ORADATA\AIRPRIM is existing on standby box and rman can write to that location (free space & permissions)
    If the issue is still present provide us the control_files parameter from standby..
    - Ravi.M

  • How to connect to the mysql database using applet from remote PC

    Hii All..
    I am also facing a problem.
    My web server and mysql server are running on the same PC.
    when i connect to the database from the same PC.
    Its connection but when i am trying to connect to the database from the different PC its giving error and not finding the driver "com.mysql.jdbc.Driver" because this is there on the server PC and applet runs on the client side..
    So to load the deriver on the client side so that it can run the applet to make the database connection on the remote PC.
    Thanks
    Uttam

    You are missing the library on the client.
    It must be moved to the client.
    Just like any other library that an applet requires.
    And that has nothing to do with JDBC.
    There are certainly way(s) to do it. Perhaps a forum that addresses applets, web usage or guis would provide an answer.

  • How to connect my access database using applet?

    hi all,
    i need to connect my access database in my applet program which should work like an atm machine..I dont know how to connect it. Im new to applet same thing in JDBC application. Please help i terribly need it, our deadline in our case study is fast approaching and i still dont know how to do it. I tried the tutorial but i received some sql exception error. thanks!

    Try this link
    http://java.sun.com/docs/books/tutorial/jdbc/basics/

  • How to connect database using JDBc?

    Hi All,
    I developed one Microsoft Access Database named "Test.mdb" in my "C" drive,
    i used
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String url = "jdbc:odbc:C:\Test";
    Connection con=DriverManager.getConnection(url);
    While executing the above code, I m getting the following error
    Error occurs java.sql.SQLException : No suitable driver
    please help me what is the problem..i did code in proper try catch block ... so dont worry but let me know what is exactly reson behibd getting this querry....
    my email id is : [email protected]
    waiting for ur reply.. its urgent

    While executing the above code, I m getting the following error
    Error occurs java.sql.SQLException : No suitable driverDon't post your e-mail.
    This error always means that the URL you gave to connect to the database is incorrect. Yours is indeed wrong:
    String url = "jdbc:odbc:C:\Test";You can correct it in either one of two ways:
    (1) Create a DNS in Windows that points to your database (call it "Test") and change the URL so it says
    String url = "jdbc:odbc:Test";(2) You can skip creating a DNS and use a connection String that looks like this:
    "jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=<database-path>";In your case, <database-path> is "C:\\Test"
    Better read a tutorial:
    http://java.sun.com/docs/books/tutorial/jdbc/
    %

Maybe you are looking for