How can I display a DB in Applet

Hi,
I have a very hard problem with this code, he work in JBuilder, but not in IE.
Thank you in advance
Sam
package adrswingappletprj;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import javax.swing.*;
import java.sql.*;
public class ADRSwingApplet extends JApplet {
boolean isStandalone = false;
JPanel JP_Principal;
JPanel JP_Fonction, JP_Affichage;
JButton BT_Quitter, BT_Plus;
JLabel JL_Error;
JLabel JL_Nom, JL_Prenom, JL_Rue, JL_CP, JL_Ville, JL_Tel, JL_Fax, JL_Mobile, JL_Email;
JTextField JTF_Nom, JTF_Prenom, JTF_Rue, JTF_CP, JTF_Ville, JTF_Tel, JTF_Fax, JTF_Mobile, JTF_Email;
//--> Objets pour se connecter sur la DB
Connection connection = null;
Statement statement = null;
StringBuffer MaRequete;
ResultSet rs;
/**Initialiser l'applet*/
public void init() {
try {
jbInit();
catch(Exception e) {
e.printStackTrace();
/**Initialiser le composant*/
private void jbInit() throws Exception {
//--> Top_Level_Container
JP_Principal = (JPanel) this.getContentPane();
JP_Principal.setLayout(new BorderLayout());
//--> Les deux JPanel + JL_Error
JP_Fonction = new JPanel();
JP_Affichage = new JPanel();
JP_Principal.add(JP_Fonction, BorderLayout.NORTH);
JP_Principal.add(JP_Affichage, BorderLayout.CENTER);
JL_Error = new JLabel(" ");
Font F = new Font("Comic Sans MS", Font.ITALIC, 9);
JL_Error.setFont(F);
JL_Error.setForeground(Color.red);
JP_Principal.add(JL_Error, BorderLayout.SOUTH);
//--> Le contenu JP_Fonction
JP_Fonction.setLayout(new FlowLayout());
//--> BT_Plus
BT_Plus = new JButton(" + ");
BT_Plus.setBackground(Color.pink);
BT_Plus.setToolTipText("Afficher le record suivant");
BT_Plus.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
Affiche_Next_Record();
//--> BT_Quitter
BT_Quitter = new JButton("Quitter");
BT_Quitter.setBackground(Color.orange);
BT_Quitter.setToolTipText("Cliquez ici pour Quitter");
BT_Quitter.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
System.exit(0);
JP_Fonction.add(BT_Plus);
JP_Fonction.add(BT_Quitter);
//--> Le contenu JP_Affichage
JP_Affichage.setLayout(new GridLayout(9, 2));
//--> Les JLabel et //--> Les JTextField
JL_Nom = new JLabel("Nom"); JTF_Nom = new JTextField();
JP_Affichage.add(JL_Nom);
JP_Affichage.add(JTF_Nom);
JL_Prenom = new JLabel("Prenom"); JTF_Prenom = new JTextField();
JP_Affichage.add(JL_Prenom);
JP_Affichage.add(JTF_Prenom);
JL_Rue = new JLabel("Rue"); JTF_Rue = new JTextField();
JP_Affichage.add(JL_Rue);
JP_Affichage.add(JTF_Rue);
JL_CP = new JLabel("CP"); JTF_CP = new JTextField();
JP_Affichage.add(JL_CP);
JP_Affichage.add(JTF_CP);
JL_Ville = new JLabel("Ville"); JTF_Ville = new JTextField();
JP_Affichage.add(JL_Ville);
JP_Affichage.add(JTF_Ville);
JL_Tel = new JLabel("Tel"); JTF_Tel = new JTextField();
JP_Affichage.add(JL_Tel);
JP_Affichage.add(JTF_Tel);
JL_Fax = new JLabel("Fax"); JTF_Fax = new JTextField();
JP_Affichage.add(JL_Fax);
JP_Affichage.add(JTF_Fax);
JL_Mobile = new JLabel("Mobile"); JTF_Mobile = new JTextField();
JP_Affichage.add(JL_Mobile);
JP_Affichage.add(JTF_Mobile);
JL_Email = new JLabel("Email"); JTF_Email = new JTextField();
JP_Affichage.add(JL_Email);
JP_Affichage.add(JTF_Email);
Connect();
//--> Config Fenetre
this.setSize(400, 300);
this.setVisible(true);
/******************* Connection sur DB *****************************/
private void Connect(){
/********* Connection sur la DB avec SQL ************/
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
connection = DriverManager.getConnection("jdbc:odbc:JAVADB", "", "");
statement = connection.createStatement();
catch(ClassNotFoundException err){}
catch(SQLException err){}
/************ Requete SQL Select sur la table ADRESSE ******/
try {
MaRequete = new StringBuffer(256);
MaRequete.append("Select * from ADRESSE");
rs = statement.executeQuery(MaRequete.toString());
if (rs.next()) {
JTF_Nom.setText(rs.getString(1));
JTF_Prenom.setText(rs.getString(2));
JTF_Rue.setText(rs.getString(3));
JTF_CP.setText(rs.getString(4));
JTF_Ville.setText(rs.getString(5));
JTF_Tel.setText(rs.getString(6));
JTF_Fax.setText(rs.getString(7));
JTF_Mobile.setText(rs.getString(8));
JTF_Email.setText(rs.getString(9));
catch(SQLException err){}
public void Affiche_Next_Record(){
try {
if (rs.next()) {
JTF_Nom.setText(rs.getString(1));
JTF_Prenom.setText(rs.getString(2));
JTF_Rue.setText(rs.getString(3));
JTF_CP.setText(rs.getString(4));
JTF_Ville.setText(rs.getString(5));
JTF_Tel.setText(rs.getString(6));
JTF_Fax.setText(rs.getString(7));
JTF_Mobile.setText(rs.getString(8));
JTF_Email.setText(rs.getString(9));
else {JL_Error.setText("Fin de la Table");}
catch(SQLException err){}
/**Obtenir les informations d'applet*/
public String getAppletInfo() {
return "Information applet";
/**Obtenir les informations de param�tre*/
public String[][] getParameterInfo() {
return null;

see if this works for you in IE
http://www.geocities.com/rmlchan/dba.html

Similar Messages

  • How can I display the HTML page from servlet which is called by an applet

    How can I display the HTML page from servlet which is called by an
    applet using the doPost method. If I print the response i can able to see the html document. How I can display it in the browser.
    I am calling my struts action class from the applet. I want to show the response in the same browser.
    Code samples will be appreciated.

    hi
    I got one way for this .
    call a javascript in showDocument() to submit the form

  • How can I display some OrdImages using a Applet in html or Jsp?

    hi
    I want to use a applet to display some images retrieved from intermedia OrdImage Object.
    Now ,I know that a applet can display some image objects or some images with their own filepaths. But we can get ordimag objects from Oracle database.And we can image data or image properties by ordimage java mathod. It is in html/Jsp environment. So how can I transform from ordimage to applet?? I appreciate someone who can help me!
    Bill

    Do you mean applet or Servlet?
    An Applet is java code that is downloaded over the web and runs in a web browser environment. Is this what you are doing?
    I suspect you are really talking about servlet/JSP environments, and the ability to include images from the database in a web page.
    In either case (applet or servlet), you want to be able to access images via a URL. For a Servlet/JSP/web page, this URL will be specified in a HTML <IMG> tag with a key as a parameter to the image you wish to view. Images are not in-line downloaded in a web page. They are access after the HTML is loaded, and are accessed with URLs, sometimes relative URLs rather than fully specified URLs.
    To deliver images to the web from the database using the PL/SQL gateway and iAS, where the procedures are generated by a wizard, see:
    http://otn.oracle.com/software/products/intermedia/htdocs/descriptions/imedia_code_wizard.html
    You can create a simple servlet (JSPs can not deliver binary data) that delivers database images using java classes. See:
    http://otn.oracle.com/software/products/intermedia/htdocs/descriptions/servlets_jsp.html
    http://otn.oracle.com/sample_code/products/intermedia/htdocs/intermedia_servlet_jsp_samples/imedia_servlet_jsp_readme.htm
    for a sample.

  • How can I remove the lable "Warning:Applet window" of pop frame in a applet

    How can I remove the lable "Warning:Applet window" of pop frame in a applet? Not only in MS IE's JVM,but also in java plug-in 1.40, the warning always display , What can I do?
    ===
    thank you!

    You cannot remove the label. It is there intentionally as a security measure, to warn the user that the window is from a running applet, so that (s)he knows it might be dangerous to enter sensitive information there (any applet from anywhere on Internet could have opened the window, who knows if it is malicious or not!).
    Perhaps you can open a window without the warning when you sign your applet (with a security certificate).
    Jesper

  • How can I display XSLT transformer errors on a web page ?

    Hi,
    I have some JSP pages that access DB, create an XML based on DB data and then transform it into HTML through an XSLT stylesheet. Developing the XSL code it's easy to make mistakes and generate errors on trasformation, but what I receive on the web page is only a "Could not compile stylesheet" TransformerConfigurationException, while the real cause of the error is displayed only on tomcat logs. This is the code for transformation:
    static public void applyXSLT(Document docXML, InputStream isXSL, PrintWriter pw) throws TransformerException, Exception {
            // instantiate the TransformerFactory.
            TransformerFactory tFactory = TransformerFactory.newInstance();
            // creates an error listener
            XslErrorListener xel = new XslErrorListener();
            // sets the error listener for the factory
            tFactory.setErrorListener(xel);
            // generate the transformer
            Transformer transformer = tFactory.newTransformer(new SAXSource(new InputSource(isXSL)));
            // transforms the XML Source and sends the output to the HTTP response
            transformer.transform(new DOMSource(docXML), new StreamResult(pw));
    }If an exception is thrown during the execution of this code, its error message is displayed on the web page.
    This is the listener class:
    public class XslErrorListener implements ErrorListener {
        public XslErrorListener() {
        public void warning(TransformerException ex) {
            // logs on error log
            System.err.println("\n\nWarning on XEL: " + ex.getMessage());
        public void error(TransformerException ex) throws TransformerException {
            // logs on error log
            System.err.println("\n\nError on XEL: " + ex.getMessage());
            // and throws it
            throw ex;
        public void fatalError(TransformerException ex) throws TransformerException {
            // logs on error log
            System.err.println("\n\nFatal Error on XEL: " + ex.getMessage());
            // and throws it
            throw ex;
    }When I have an error in the XSL stylesheet (for examples a missing closing tag), I can find on tomcat logs the real cause of the error:
    [Fatal Error] :59:10: The element type "table" must be terminated by the matching end-tag "</table>".
    Error on XEL: The element type "table" must be terminated by the matching end-tag "</table>".but on my web page is reported just the TransformerConfigurationException message that is:
    "Could not compile stylesheet".
    How can I display the real cause of the error directly on the web page?
    Thanks,
    Andrea

    This code is part of a bigger project that let developers edit XSL stylesheets through a file upload on the system and we can't impose the use of any tool for checking the xsl. So, I need to display the transformer error on the web page.I see. This code is part of an editorial/developmental tool for developers to create and edit XSL stylesheets.
    As part of the editorial process, XSL errors during editing can be considered a normal condition. In other words, it is normal to expect that the developers will generate XSL errors as they are developing stylesheets.
    In this light, handling the XSL transformation errors is a business requirement that you need to handle. Using the Java Exceptions mechanisms, e.g. try / catch are inappropriate to handle business requirements, in my opinion.
    I suggest that you look at how you handle the occurence of XSL errors differently than what you currently have. You need to:
    (1) capture the Transformation exception on the server;
    (2) extract the message from the exception and put it into a message that can be easily understood by the user;
    The current error message that you have going to the web browser is not useful.
    And you should not have the Transformation exception sent to the web browser either.
    What you are attempting to do with the exception is not appropriate.
    Handle the Transformation exception on the Business tier and use it to create a useful message that is then sent to the Presentation tier. In other words, do not send Java exceptions to web browser.
    />

  • How can I display True/False in my dropdownlist as "Yes" and "No"?

    Hi All,
    I want to bind a dropdownlist to a boolean value (so it's either true or false).  I'm particularly interested in using two-way binding to when the user changes from "yes" to "no" the boolean value automatically changes from "true" to "false."  But, I want the user to see "yes" and "no" as the options, rather than "true" and "false".
    How can I display "yes" and "no" and still take advantage of binding?  Or can I not use binding in this circumstance?
      -Josh

    Solution 1:
    In order to display Yes/No for True/False, you may specify labelFunction for the dropdownList.
    In MXML:
    <s:DropDownList labelFunction="myLabelFunction" />
    In actionscript:
    private var arr:ArrayCollection = new ArrayCollection(["true","false"]);
                private function mylabelFunction(item:Object):String
                    if(item.toString() == "true")
                        return "yes";
                    else return "No";
    OR
    Solution2:
    may be u can try making an array collection like
    private var arr:ArrayCollection = new ArrayCollection([{label:"yes",value:"true"},{label:"no",value:"false"}]);
    and specify labelField for the dropdownList like
    <s:DropDownList labelField="label" dataProvider="{arr}" />

  • How can I display  contacts in a relationship

    I have companies in my CRM. I have a customers/contacts in the CRM I have tied as a relationship with each companies. How can I display all the records/contacts associated with a company? I have a already created a secure zone, so the company user would have logged in. Is this possible? If not, any workaround?
    The only workaround I thought of is to use webapp to import the company data and create another web app containing the employees data. Then link both tables/webapp using datasource. But the way the client's data is structured could create a lot of problems going forward.
    Any suggestion, help will be appreciated

    The relationship feature and how companies work currently in BC is really limited. It is an association and not true relationships at the moment. You cant output a company and show all its relationships at the moment.

  • How can I display & split the audio & video from the same digitized clip?

    I digitized a scene into iMovie that I edited on a professional system which I don't have access to anymore. The whole scene is 1 clip. Now I see a few tweaks that I want to make, so I was hoping to do them in iMovie.
    I want to "pull up" the audio in one section - meaning I want to take cut about 20 frames of audio from the end of a shot, and then move all the other audio up to fill the hole. To compensate for the missing 20 frames, I'll cut video off the head of the next shot. Some call this prelapping. Some call it an L-cut. Some call it asymmetrical trimming. Either way, I can't figure out how to do it in iMovie.
    My clip appears in the timeline as one track - a single track that contains the video and 2 audio tracks. How can I display the audio that's tied to the video on its own track? Then I think I could split audio & video wherever I wanted and trim things up - but I can't figure out how to do it.
    Am I asking too much of this software?
    BTW, I never see the option to "Split audio clip at playhead". I'm not displaying clip volume or waveforms. Choosing to display waveforms doesn't show me anything. Maybe iMovie thinks I'd only want to see waveforms of audio that isn't tied to my video-and-audio clips?
    Thanks in advance for any help...

    Jordon,
    "Am I asking too much of this software?"
    No, you're not.
    You first want to select your clip(s) and choose Advanced>Extract Audio.
    This will copy the audio from the video clip and place it on one of the two separate audio tracks while lowering the audio level to zero in the original video track.
    You can now edit and move the audio independently of the video.
    With the audio clip selected, you'll find you now have access to Edit>Split Selected Audio Clip at Playhead.
    Matt

  • How can i display a list of all the names stored in the Mail app?

    When sending an email, the program shows a list of names according to the first and subsequent letters that I type into the To: field. There are times I cannot recall someone's email user name. How can I display a complete list of all the names Mail has stored? I know that I can go to the To: field then type in the letter A, then write down all listings under A, and then repeat for each letter of the alphabet, but there should be an easier method.
    I have perhaps dozens of names in Mail, but only five names in Address Book, so the latter does me no good.

    On the menubar, Mail > Window > Previous Recipients
    Regards,
    Captfred

  • How can I display more than one value in Calendar ?

    Hi,
    the standard (example) script allows for the display of one value only (as I understood). How can I display two or three values, from the very same table ? Students of mine during an HTMLDB workshop in Leipzig did ask that question.
    Do we have a more detailed docum. on the use of the calendar ?
    pls kindly advise. TIA.
    Bernhard

    my solution:
    Source fo the calendar starts:
    snip>
    declare
    q varchar(32767) := null;
    begin
    q := 'select "ETA", <--- Date Field and concatination of fields as follows:
    "SCHIFFSNAME"|| "ETA_TIME"|| "TERMINAL"||''(br*)'',
    null,
    null,
    null,
    null
    from "#OWNER#"."SCHEDULE"'; . . . . . . .
    snip>
    comment on (br*) - you have to use "<" and ">" instead of "( " and ")" to have the "break/new line effect"
    brgds
    Bernhard

  • How can I display images that are not included in any collection?

    How can I display images that are not included in any collection (some filter or smart collection)? A smart collection with parameters "Collection - contains - empty field" does not work. Lightroom 5.

    Thank you! Good idea! I ordered letters of the alphabet (space separated), and it works.

  • How can i display all the query items to a table?

    how can i display all the query items to a table in a jsp file?
    i always have an out of memory error..

    any body??any idea?
    is it possible thru configuration or i have to write a program by the abaper??
    Biswa

  • How can I display all of my bookmarks along the left side of my browser window like earlier versions of Firefox?

    I like the bookmarks on the left side of the screen. I don't want to be navigating through a tree of all of my various bookmarks. How can I display all of my bookmarks along the left side of my browser window like earlier versions of Firefox?

    View > Sidebar > Bookmarks (Ctrl+B)
    Press F10 or tap the Alt key to bring up the "Menu Bar" temporarily if the Menu Bar is hidden.
    *https://support.mozilla.com/kb/how-do-i-use-bookmarks

  • How can I display all my e-mails.  Only some of them show up now...thanks to an apple representative in the apple store

    How can I display all my e-mails on all my Apple products?  Only some of them show up now...thanks to an apple representative in the apple store.  Also, he put my oldest emails in POP (???)

    How can I display all my e-mails on all my Apple products?  Only some of them show up now...thanks to an apple representative in the apple store.  Also, he put my oldest emails in POP (???)

  • How can I display all my films in iTunes, on my iPhone 4S?

    How can I display all my films in iTunes, on my iPhone 4S?
    I have 10 films in iTunes and only 8 are displayed on my iPhone.
    All 10 films are Digital Copies bought with Blu-ray Discs and have been added to iTunes.

    Sync the other two the same way you synced the first 8.
    Select them in iTunes and sync.

Maybe you are looking for

  • Request to Mods. re: Yoga Tablet pro 2 not wakeable after it goes to sleep

    We have a number of posts regarding the Yoga Tablet Pro 2 going to sleep and not waking up.  Can we get some kind of confirmation that this is actively being worked on or passed along?  I feel most of us have tried to do a factory reset, for some it'

  • Moutain Lion Screen flashing grey and Dock crashing

    Hello, I have some serious trouble since I installed Mountain Lion on my iMac 2008 21'. My Desktop plashing grey and more my dock continuously crashing thereafter the log I could find in the console : Process:     Dock [943] Path:        /System/Libr

  • Fails to recognise flash drive

    I recently bought a flash drive of Sandisk Cruzer Pop 32 GB.  My iMac fails to recognise it frequently - more than 50%.  However it works well with my MBA. The failure is either not to recongise the drive at all or eject it automatically.  The failur

  • Invoice Block at customer account

    HI, Is there any block (Invoice Block) by which even if a particular customer account is used as Sold to Party while creating a sales order, no invoice is being generated against it ? I dont want credit block through FD33. i have tried various blocks

  • HTTP-404 No DAD configuration found or no default home page

    Hi, No EBS login page was available this morning but all services appeared to be online as usual. I restarted Apps Tier and could then see login page. Now I have to find out what happened. There is nothing in the db log file, the listener log, the cc