Subject | Database ... Shutdown |
---|---|
Author | Thomas Gustavo Dietrich |
Post date | 2006-12-31T16:29:01Z |
Error while connect to Firebird 2 from Java / Jaybird.
I made this class:
*******************
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;
public class TesteFirebird {
public static void main(String[] args) {
try{
Connection con1 = getConnection();
Connection con2 = getConnection();
Statement st1 = con1.createStatement();
ResultSet rs1 = st1.executeQuery( "select * from usuarios;" );
rs1.next();
System.out.println( "rs1 try 1: " + rs1.getString( 1 ) );
Statement st2 = con2.createStatement();
ResultSet rs2 = st2.executeQuery( "select * from empregados;" );
rs2.next();
System.out.println( "rs2: " + rs2.getString( 1 ) );
rs1.next();
System.out.println( "rs1 try 2: " + rs1.getString( 1 ) );
} catch (Exception e) {
e.printStackTrace();
}
}
private static Connection getConnection() throws SQLException,
ClassNotFoundException{
Class.forName("org.firebirdsql.jdbc.FBDriver");
Properties props = new Properties();
props.setProperty("user", "SYSDBA");
props.setProperty("password", "masterkey" );
props.setProperty("encoding", "ISO8859_1" );
return DriverManager.getConnection(
"jdbc:firebirdsql:127.0.0.1:/home/thomas/test.fdb", props );
}
}
*******************
and occurs this error:
*******************
org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544528.
database /home/thomas/test.fdb shutdown
Reason: database /home/thomas/test.fdb shutdown
at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:122)
at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:131)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at TesteFirebird.getConnection(TesteFirebird.java:38)
at TesteFirebird.main(TesteFirebird.java:12)
at org.firebirdsql.gds.GDSException: database /home/thomas/test.fdb shutdown
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.readStatusVector(AbstractJavaGDSImpl.java:2124)
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.receiveResponse(AbstractJavaGDSImpl.java:2074)
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.internalAttachDatabase(AbstractJavaGDSImpl.java:414)
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.iscAttachDatabase(AbstractJavaGDSImpl.java:370)
at org.firebirdsql.jca.FBManagedConnection.<init>(FBManagedConnection.java:89)
at org.firebirdsql.jca.FBManagedConnectionFactory.createManagedConnection(FBManagedConnectionFactory.java:470)
at org.firebirdsql.jca.FBStandAloneConnectionManager.allocateConnection(FBStandAloneConnectionManager.java:69)
at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:119)
at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:131)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at TesteFirebird.getConnection(TesteFirebird.java:38)
at TesteFirebird.main(TesteFirebird.java:12)
*******************
Somebody help me?
[]'s
I made this class:
*******************
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;
public class TesteFirebird {
public static void main(String[] args) {
try{
Connection con1 = getConnection();
Connection con2 = getConnection();
Statement st1 = con1.createStatement();
ResultSet rs1 = st1.executeQuery( "select * from usuarios;" );
rs1.next();
System.out.println( "rs1 try 1: " + rs1.getString( 1 ) );
Statement st2 = con2.createStatement();
ResultSet rs2 = st2.executeQuery( "select * from empregados;" );
rs2.next();
System.out.println( "rs2: " + rs2.getString( 1 ) );
rs1.next();
System.out.println( "rs1 try 2: " + rs1.getString( 1 ) );
} catch (Exception e) {
e.printStackTrace();
}
}
private static Connection getConnection() throws SQLException,
ClassNotFoundException{
Class.forName("org.firebirdsql.jdbc.FBDriver");
Properties props = new Properties();
props.setProperty("user", "SYSDBA");
props.setProperty("password", "masterkey" );
props.setProperty("encoding", "ISO8859_1" );
return DriverManager.getConnection(
"jdbc:firebirdsql:127.0.0.1:/home/thomas/test.fdb", props );
}
}
*******************
and occurs this error:
*******************
org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544528.
database /home/thomas/test.fdb shutdown
Reason: database /home/thomas/test.fdb shutdown
at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:122)
at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:131)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at TesteFirebird.getConnection(TesteFirebird.java:38)
at TesteFirebird.main(TesteFirebird.java:12)
at org.firebirdsql.gds.GDSException: database /home/thomas/test.fdb shutdown
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.readStatusVector(AbstractJavaGDSImpl.java:2124)
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.receiveResponse(AbstractJavaGDSImpl.java:2074)
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.internalAttachDatabase(AbstractJavaGDSImpl.java:414)
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.iscAttachDatabase(AbstractJavaGDSImpl.java:370)
at org.firebirdsql.jca.FBManagedConnection.<init>(FBManagedConnection.java:89)
at org.firebirdsql.jca.FBManagedConnectionFactory.createManagedConnection(FBManagedConnectionFactory.java:470)
at org.firebirdsql.jca.FBStandAloneConnectionManager.allocateConnection(FBStandAloneConnectionManager.java:69)
at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:119)
at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:131)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at TesteFirebird.getConnection(TesteFirebird.java:38)
at TesteFirebird.main(TesteFirebird.java:12)
*******************
Somebody help me?
[]'s