Results 1 to 2 of 2
  1. #1
    lemurian is offline Member
    Join Date
    Apr 2008
    Posts
    1
    Rep Power
    0

    Default Help with Java and MS access

    I have the next problem. I want to make a little translation program, I have in access a table that has two columns Español and Frances.
    I'm using a JtextBox to introduce a spanish word, for example ROJO, and I want to retrieve the french word rouge.
    The query sentence shows me the last word in Frances. I have the following structure:

    Español Frances
    rojo rouge
    negro noir

    and this is the code
    try
    {
    String ruta = "C:\\dicc.mdb";
    String referencia = "jdbc:odbc:MS Access Database;DBQ="+ruta;

    //Levantar controlador o carga el controlador
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection conecta = DriverManager.getConnection(referencia);
    Statement s = conecta.createStatement();
    ResultSet rs = s.executeQuery("SELECT Español, Frances FROM espfran =");

    while(rs.next())
    {
    res=rs.getString("Frances");
    }
    jLabel.setText(res);
    conecta.close();
    }
    catch(Exception jl)
    {
    JOptionPane.showMessageDialog(null,jl.getMessage() );
    }

    Hope someone can help me. please email me @ lemurianredmage@hotmail.com

  2. #2
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    7

    Default

    You can also post this into database forum.
    THere are experts there who could help you about this.

    Admin, email was introduced.... Is this allowed?

    regards,
    sukatoa
    freedom exists in the world of ideas

Similar Threads

  1. Java Native Access (JNA) return types of void *
    By burnumd in forum Advanced Java
    Replies: 5
    Last Post: 01-15-2010, 12:09 AM
  2. Replies: 1
    Last Post: 03-13-2008, 02:36 PM
  3. Replies: 1
    Last Post: 08-07-2007, 07:51 AM
  4. Access Email usind a java mail client Access Email usind a java mail client
    By consult4u in forum Enterprise JavaBeans (EJB)
    Replies: 2
    Last Post: 07-31-2007, 08:29 AM
  5. How to access system calls in java
    By Albert in forum New To Java
    Replies: 1
    Last Post: 07-13-2007, 03:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •