gpt4 book ai didi

android - 无法从 Android 连接到 Firebird 服务器

转载 作者:太空宇宙 更新时间:2023-11-03 10:18:38 27 4
gpt4 key购买 nike

我正在使用 Jaybird 连接到 Firebird sql,我的应用程序连接正常。但是今天我无法连接。

我所做的唯一更改是在 android studio 的检查器中执行自动校正器。我不知道是什么导致了这个错误。

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

我的类(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) {
}
}

最佳答案

正如我昨天的评论所暗示的,该错误意味着您的用户名和/或密码不正确(错误 335544472 = 您的用户名和密码未定义。请您的数据库管理员设置 Firebird 登录。 )。我不明白这怎么可能是由格式/布局更改引起的。

您的用户名或密码已更改(在您的代码中或在服务器上),或者您正在连接到与预期不同的 Firebird 服务器。

如果您尝试连接到 Firebird 3(测试版/RC)服务器而没有设置对旧版身份验证的支持,也可能会发生此错误。另见 Jaybird and Firebird 3.0 Beta 2 .

您可能还想检查 Jaybird for android 的安装,因为它似乎缺少错误消息属性文件。

关于android - 无法从 Android 连接到 Firebird 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30079273/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com