Erro ao Conectar no Banco de Dados

1. Erro ao Conectar no Banco de Dados

Bol Aum
Bolaum

(usa Ubuntu)

Enviado em 06/04/2016 - 10:13h

Bom dia, quando eu tento conectar no banco de dados pelo Java ele me retorna o seguinte erro:

Exception in thread "main" org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544344. I/O error during "open" operation for file "samba/LNX.FDB"
Error while trying to open file
null
at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:120)
at org.firebirdsql.jdbc.AbstractDriver.connect(AbstractDriver.java:136)
at java.sql.DriverManager.getConnection(DriverManager.java:571)
at java.sql.DriverManager.getConnection(DriverManager.java:215)
at br.com.ipsnet.jdbc.ConnectionFactory.getConnection(ConnectionFactory.java:16)
at br.com.ipsnet.jdbc.ConnectionFactory.main(ConnectionFactory.java:22)
Caused by: org.firebirdsql.gds.GDSException: I/O error during "open" operation for file "samba/LNX.FDB"
Error while trying to open file
null
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.readStatusVector(AbstractJavaGDSImpl.java:2098)
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.receiveResponse(AbstractJavaGDSImpl.java:2048)
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.internalAttachDatabase(AbstractJavaGDSImpl.java:463)
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.iscAttachDatabase(AbstractJavaGDSImpl.java:411)
at org.firebirdsql.jca.FBManagedConnection.<init>(FBManagedConnection.java:105)
at org.firebirdsql.jca.FBManagedConnectionFactory.createManagedConnection(FBManagedConnectionFactory.java:509)
at org.firebirdsql.jca.FBStandAloneConnectionManager.allocateConnection(FBStandAloneConnectionManager.java:65)
at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:118)
... 5 more

O código:


public static Connection getConnection() throws SQLException {
Connection connection = null;
try {
Class.forName("org.firebirdsql.jdbc.FBDriver");
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
connection = DriverManager.getConnection("jdbc:firebirdsql://localhost:3050/samba/LNX.FDB", "sysdba",
"masterkey");
return connection;
}

public static void main(String[] args) throws SQLException {
getConnection();
}


Se eu vou na pasta /samba e digito:

isql-fb
connect "localhost:/samba/LNX.FDB" user 'SYSDBA' password 'masterkey';


Ele conecta numa boa, faz select sem problema nenhum.

Não consigo acessar nem pelo Java e nem pelo IBExpert pela rede. Pelo IBExpert ele retorna o erro:


Unable to complete network request to host "Server-Teste".
Failed to estabiligh connection.


Edit: Esqueci de mencionar que pelo Flamerobin ele da o seguinte erro:


An assertion failed!

../src/common/strconv.cpp(3031): assert "Assert failure" failed in wxCSConv(): invalid encoding value in wxCSConv ctor


Mas consegue conectar.