Error connecting to Database - Firebird/Java

Asked

Viewed 363 times

0

I am trying to connect a java desktop application to a Firebird database and the eclipse console shows the following error: "PM org.firebirdsql.logging.Jullogger warn: WARNING: No Connection Character set specified (Property lc_ctype, encoding, charset or localEncoding), defaulting to Character set NONE".

I’m using Jaybird 4 for java 8 and jdbc 4.2.

Below the method of my connection:

protected boolean conectaLD()
{
    {

    String driverName = "org.firebirdsql.jdbc.FBDriver";
    Class.forName(driverName);

    String databaseURL = "jdbc:firebirdsql:192.168.0.32:c:/bdteste/dosimetria.fdb";

    con_LD = DriverManager.getConnection(databaseURL,"claudio","alparole");

    con_LD.setAutoCommit(false);

    stmt_LD = con_LD.createStatement();
    stmt_LD2 = con_LD.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);

    }
    catch(java.lang.Exception ex)
    {
        con_LD = null;
        JOptionPane.showMessageDialog(null,""+ex.getMessage(),"1 - Falha ao criar uma Connection :",0);
        return false;
    }
    return true;

} 

1 answer

0

To avoid errors like this you need to know the version of Firebird and Java installed. In my project I am using Firebird 2.5 and Java 8. The error occurred because the JDBC drive version was incompatible with the Firebird version. I checked the Firebird version and found it to be 2.5, so I solved the error by downloading Jaybird 2.2.15 for Java 8 and adding the jar to my project.

If you have more questions about this, see the documentation in section 9.8: https://firebirdsql.github.io/jaybird-manual/jaybird_manual.html?fbclid=IwAR2Pr2Mphn0lrDFKl2NggpcHqn_THsCEXLIqyLl_h_s-zcKCVjEujXkNDA0#_available_encodings

Browser other questions tagged

You are not signed in. Login or sign up in order to post.