Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8634109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:38:24+00:00 2026-06-12T09:38:24+00:00

Im developing an applet in eclipse, when executed from the eclipse’s AppletViewer it works

  • 0

Im developing an applet in eclipse, when executed from the eclipse’s AppletViewer it works correctly but when executed from an .html file it dont execute class.forName() method.

here the .html

<!DOCTYPE html>
<html>
<body>

<p>Tarjetero.</p>

<applet 
codebase="classes"
code="ap.class"
width=234 height=274
archive="jaybird-full-2.2.0.jar">
</applet>

</body>
</html>

in the same folder I have all the created .class and jaybird .jar archive

here java files

ap.java

import javax.swing.JApplet;


public class ap extends JApplet {

/**
 * 
 */
private static final long serialVersionUID = 1L;

ui inter = new ui();

@Override
public void init() {
    // TODO Auto-generated method stub
    //JPanel p = new JPanel();
    //p.add(new JLabel("prueba"));
    inter.setVisible(true);
    this.add(inter);
}

@Override
public void start() {
    // TODO Auto-generated method stub
    super.start();
}

}

ui.java

import javax.swing.JPanel;


public class ui extends JPanel {

static JButton btnNewButton;
/**
 * 
 */
private static final long serialVersionUID = 1L;

/**
 * Create the panel.
 */
public ui() {
    setLayout(null);

     btnNewButton = new JButton("New button");

    btnNewButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            try {
                btnNewButton.setText("1");
            ConexFirebird cf = new ConexFirebird();
            btnNewButton.setText("2");
            ResultSet rs = cf.EjecutarSentencia("SELECT nombre FROM CLIENTES;");
            btnNewButton.setText("3");


                if(rs.next())
                {
                    btnNewButton.setText("datos");
                }
                else
                {
                    btnNewButton.setText("nodatos");
                }
            } catch (Exception e) {
                // TODO Auto-generated catch block
                btnNewButton.setText(e.getMessage());
                e.printStackTrace();
            }

        }
    });
    btnNewButton.setBounds(12, 12, 117, 24);
    add(btnNewButton);

    JRadioButton rdbtnNewRadioButton = new JRadioButton("New radio button");
    rdbtnNewRadioButton.setBounds(8, 44, 149, 22);
    add(rdbtnNewRadioButton);

    JCheckBox chckbxNewCheckBox = new JCheckBox("New check box");
    chckbxNewCheckBox.setBounds(18, 70, 129, 22);
    add(chckbxNewCheckBox);

}
}

conexFirebird.java

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.sql.*;
import javax.swing.JOptionPane;


/**
*
* @author Jose
*/
public class ConexFirebird {
// static File directorio= new File("//");
//static String DireccionBD="jdbc:firebirdsql:192.168.47.254/3050:/BBDD/ArenasTiradoJoseMTarjetero.fdb";
static String DireccionBD="jdbc:firebirdsql:localhost/3050:/var/lib/firebird/2.5/data/tarjetavisitas.fdb";
static String Usuario="sysdba";
//static String Contrasena="persiza";
String Contrasena="masterkey";

static String NombreDriver="org.firebirdsql.jdbc.FBDriver";

static Connection Conexion;
static Statement Consulta;
static ResultSet Resultado;

public ConexFirebird()
{
        try
    {

            ui.btnNewButton.setText("10");
       Class.forName(NombreDriver) ;
       ui.btnNewButton.setText("11");
       Conexion = DriverManager.getConnection(DireccionBD, Usuario, Contrasena);           
       ui.btnNewButton.setText("12");
       Consulta = Conexion.createStatement();
       ui.btnNewButton.setText("13");


    }
    catch (ClassNotFoundException e) {
        // TODO: handle exception
        ui.btnNewButton.setText("classNfound");
    }
    catch(Exception e)
    {
        ui.btnNewButton.setText("23");
        JOptionPane.showMessageDialog(null, e.getMessage());

    }
}

public void EjecutarInsert(String Sentencia)
{
    try {
        Consulta.execute(Sentencia);
        JOptionPane.showMessageDialog(null, "Guardado correctamente", "Guardado", JOptionPane.INFORMATION_MESSAGE);
    } catch (SQLException e) {
        // TODO Auto-generated catch block
        JOptionPane.showMessageDialog(null, "Ese DNI ya se encuentra en la base de datos", "Error", JOptionPane.INFORMATION_MESSAGE);
    }
}


public ResultSet EjecutarSentencia(String Sentencia)
{
    try
    {
    Resultado = Consulta.executeQuery(Sentencia);
    }
    catch(Exception e)
    {
        JOptionPane.showMessageDialog(null, e.getMessage()+"ejecutar sentencia");
    }

    return Resultado;
}


public void EjecutarUpdate(String Sentencia) throws SQLException
{
   try
    {
    Consulta.executeUpdate(Sentencia);


    }
    catch(SQLException e)
    {

        //JOptionPane.showMessageDialog(null, e.getMessage());
        throw new SQLException("");

    } 
}

public void CerrarConexion()
{
    try
    {
    Consulta.close();
    }
    catch(Exception e)
    {

    }
}

public void insertarConBlob(String nombre, String dni, String correo, File fD, File fA)
{
    try {
        PreparedStatement ps;
        if(fD != null && fA != null)
        {
            ps = Conexion.prepareStatement("INSERT INTO CLIENTES (ID, NOMBRE, DNI, CORREO, FOTODELANTE, FOTODETRAS ) VALUES ( gen_id(id_clientes, 1), '"+nombre+"', '"+dni+"', '"+correo+"', ?, ?)");
            try{
            ps.setBlob(1, new FileInputStream(fD));
            ps.setBlob(2, new FileInputStream(fA));
            ps.execute();
            JOptionPane.showMessageDialog(null, "Guardado correctamente", "Guardado", JOptionPane.INFORMATION_MESSAGE);
            }
            catch(FileNotFoundException e)
            {
                JOptionPane.showMessageDialog(null, "No se encontro el archivo", "Error", JOptionPane.INFORMATION_MESSAGE);
            }
            catch(SQLException e)
            {
                JOptionPane.showMessageDialog(null, "Ese DNI ya se encuentra en la base de datos", "Error", JOptionPane.INFORMATION_MESSAGE);
            }
        }
        else if (fD != null)
        {
            ps = Conexion.prepareStatement("INSERT INTO CLIENTES (NOMBRE, DNI, CORREO, FOTODELANTE) VALUES ( '"+nombre+"', '"+dni+"', '"+correo+"', ?)");
            try{
            ps.setBlob(1, new FileInputStream(fD));
            ps.execute();
            }
            catch(FileNotFoundException e)
            {
                JOptionPane.showMessageDialog(null, "No se encontro el archivo", "Error", JOptionPane.INFORMATION_MESSAGE);
            }
        }
        else if (fA != null)
        {
            ps = Conexion.prepareStatement("INSERT INTO CLIENTES (NOMBRE, DNI, CORREO, FOTODETRAS) VALUES ( '"+nombre+"', '"+dni+"', '"+correo+"', ?)");
            try{
            ps.setBlob(1, new FileInputStream(fA));
            ps.execute();
            }
            catch(FileNotFoundException e)
            {
                JOptionPane.showMessageDialog(null, "No se encontro el archivo", "Error", JOptionPane.INFORMATION_MESSAGE);
            }
        }






    } catch (SQLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

}

I know all these java files can be improved.
I have to use that button label changing to debug because I CANT find the console in iceweasel

OS: Debian
Browser: Iceweasel
java jdk 1.6
jaybird 2.2.0

Thanks in advance, all you need to answer the question just ask for it! thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:38:26+00:00Added an answer on June 12, 2026 at 9:38 am

    Jaybird was not designed with Applets in mind, as far as I know it will generate an error (when run in the browser) because it tries to read a system property. It will work in AppletViewer as that – afaik – runs with all permissions.

    See also:

    • http://tracker.firebirdsql.org/browse/JDBC-254
    • NoClassDefFoundError with jdbc applet

    Also make sure that you use jaybird-2.2.1.jar in combination with connector-api-1.5.jar, or jaybird-full-2.2.1.jar (which contains the classes from connector-api), because the driver cannot work without it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently developing an applet for some OpenGL ES stuff but I am
I'm developing an applet that requires to save a text file on the server.
I'm developing an applet in Java 1.6 which is supposed (ofcourse) to run on
Developing a project in Django with my IDE setup as Eclipse with PyDev. The
We're developing an applet and need it to be able to read/write files in
I'm developing a recorder in silverlight and I need to upload data from stream
While developing an applet, I created a maven project with .jar packaging and different
I'm developing a Java Applet, and reducing the size of the binary code will
I am developing an .aspx page which will ultimately launch an applet after the
I am developing an online multiplayer game, but I am struggling with Apple documentation.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.