简体   繁体   English

无法从Android连接到Firebird服务器

[英]Unable to connect to Firebird server from android

I'm using Jaybird to connect to Firebird sql, my app was connected normally. 我正在使用Jaybird连接到Firebird sql,我的应用程序正常连接。 But today I can't connect. 但今天我无法连接。

The only change I made was to execute the auto corrector in inspector, in android studio. 我做的唯一改变是在android studio中的inspector中执行自动校正器。 I have no idea what is causing this error. 我不知道是什么导致了这个错误。

05-06 10:55:58.067  16653-16755/br.cardapionewpointer W/System.err﹕ org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544472. No message for code 335544472 found.
05-06 10:55:58.067  16653-16755/br.cardapionewpointer W/System.err﹕ at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:123)
05-06 10:55:58.067  16653-16755/br.cardapionewpointer W/System.err﹕ at org.firebirdsql.jdbc.AbstractDriver.connect(AbstractDriver.java:126)
05-06 10:55:58.067  16653-16755/br.cardapionewpointer W/System.err﹕ at java.sql.DriverManager.getConnection(DriverManager.java:179)
05-06 10:55:58.067  16653-16755/br.cardapionewpointer W/System.err﹕ at br.cardapionewpointer.TestaConn.doInBackground(TestaConn.java:42)
05-06 10:55:58.067  16653-16755/br.cardapionewpointer W/System.err﹕ at br.cardapionewpointer.TestaConn.doInBackground(TestaConn.java:20)
05-06 10:55:58.067  16653-16755/br.cardapionewpointer W/System.err﹕ at android.os.AsyncTask$2.call(AsyncTask.java:288)
05-06 10:55:58.067  16653-16755/br.cardapionewpointer W/System.err﹕ at java.util.concurrent.FutureTask.run(FutureTask.java:237)
05-06 10:55:58.067  16653-16755/br.cardapionewpointer W/System.err﹕ at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
05-06 10:55:58.067  16653-16755/br.cardapionewpointer W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
05-06 10:55:58.067  16653-16755/br.cardapionewpointer W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
05-06 10:55:58.067  16653-16755/br.cardapionewpointer W/System.err﹕ at java.lang.Thread.run(Thread.java:841)
05-06 10:55:58.067  16653-16755/br.cardapionewpointer W/System.err﹕ Caused by: org.firebirdsql.gds.GDSException: No message for code 335544472 found.
05-06 10:55:58.067  16653-16755/br.cardapionewpointer W/System.err﹕ at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.readStatusVector(AbstractJavaGDSImpl.java:2092)
05-06 10:55:58.067  16653-16755/br.cardapionewpointer W/System.err﹕ at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.receiveResponse(AbstractJavaGDSImpl.java:2042)
05-06 10:55:58.067  16653-16755/br.cardapionewpointer W/System.err﹕ at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.internalAttachDatabase(AbstractJavaGDSImpl.java:457)
05-06 10:55:58.067  16653-16755/br.cardapionewpointer W/System.err﹕ at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.iscAttachDatabase(AbstractJavaGDSImpl.java:411)
05-06 10:55:58.067  16653-16755/br.cardapionewpointer W/System.err﹕ at org.firebirdsql.jca.FBManagedConnection.<init>(FBManagedConnection.java:105)
05-06 10:55:58.067  16653-16755/br.cardapionewpointer W/System.err﹕ at org.firebirdsql.jca.FBManagedConnectionFactory.createManagedConnection(FBManagedConnectionFactory.java:490)
05-06 10:55:58.077  16653-16755/br.cardapionewpointer W/System.err﹕ at org.firebirdsql.jca.FBStandAloneConnectionManager.allocateConnection(FBStandAloneConnectionManager.java:69)
05-06 10:55:58.077  16653-16755/br.cardapionewpointer W/System.err﹕ at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:120)
05-06 10:55:58.077  16653-16755/br.cardapionewpointer W/System.err﹕ ... 10 more

My class: 我的课:

public class TestaConn extends AsyncTask<Integer,Object,Integer> {
    private final Activity activity;
    private int opt;
    public TestaConn(Activity activity) {
        this.activity = activity;
    }

    @Override
    protected Integer doInBackground(Integer... bt) {
        opt = bt[0];
        try{
            Class.forName("org.firebirdsql.jdbc.FBDriver");
        }catch(Exception e){
            System.err.println(e.getMessage());
        }
        try{
            Properties props = new Properties();
            props.setProperty("user", "xx");
            props.setProperty("password", "xx");
            props.setProperty("encoding", "WIN1252");
            DBLiteConnection bdl = new DBLiteConnection(activity);
            String ip = bdl.searchip();
            Connection conn = DriverManager.getConnection("jdbc:firebirdsql://" + ip + "", props);
            String sSql = "SELECT CD_CHAVE FROM TAB_PARAM";
            Statement stmt = conn.createStatement();
            ResultSet rs = stmt.executeQuery(sSql);
            if(rs.next())
            {
                rs.close();
                return 1;
            }
            rs.close();
        }
        catch(SQLException e1){
            e1.printStackTrace();
            return 0;
        }
        return 0;
    }

    @Override
    public void onPostExecute(Integer i) {
    }
}

As implied by my comment from yesterday, the error means that your username and/or password is incorrect (error 335544472 = Your user name and password are not defined. Ask your database administrator to set up a Firebird login. ). 正如我昨天发表的评论所暗示的那样,错误意味着您的用户名和/或密码不正确(错误335544472 = 您的用户名和密码未定义。请您的数据库管理员设置Firebird登录信息。 )。 I don't see how this could be caused by a format/layout change. 我不知道这是如何由格式/布局更改引起的。

Either your username or password has been changed (in your code or on the server), or you are connecting to a different Firebird server than you expect. 您的用户名或密码已更改(在您的代码或服务器上),或者您正在连接到不同于您期望的Firebird服务器。

This error could also happen if you attempt to connect to a Firebird 3 (beta/RC) server without setting up support for legacy authentication. 如果您尝试连接到Firebird 3(beta / RC)服务器而不设置对旧版身份验证的支持,也可能发生此错误。 See also Jaybird and Firebird 3.0 Beta 2 . 另请参阅Jaybird和Firebird 3.0 Beta 2

You might also want to check the install for Jaybird for android, as it seems to be missing the error message properties file. 您可能还想检查Jaybird for android的安装,因为它似乎缺少错误消息属性文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM