Pessoal, não estou conseguindo conectar num banco FireBird… Poderiam me ajudar??
//package servicos;
import javax.swing.*;
import java.sql.*;
public class ExportaContratos {
private static ExportaContratos instancia = new ExportaContratos();
private static Connection con;
public static ExportaContratos obterInstancia() {
return instancia;
}
public Connection conexao() {
try {
Class.forName("org.firebirdsql.jdbc.FBDriver"); // .newInstance();
con = DriverManager
.getConnection(
"jdbc:firebirdsql:127.0.0.1/3055:C:/teste.fdb",
"SYSDBA", "masterkey");
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Erro de acesso ao banco!",
"Mensagem", JOptionPane.ERROR_MESSAGE);
}
return con;
}
public void fechar() {
try {
con.close();
} catch (Exception e) {
e.printStackTrace();
JOptionPane.showMessageDialog(null,
"Erro ao tentar fechar o banco!", "Mensagem",
JOptionPane.ERROR_MESSAGE);
}
}
}
O erro:
Firebird driver command line db create/drop tool
This works only on localhost. Use filename rather than jdbc url.
create:-create -user -password
drop:-drop
flags -create may be abbreviated as -c, etc.`