Subject Re: [Firebird-Java] Firebird with Jaybird
Author LEANDRO (YAHOO)
to conect...

public class AristarcusDatabase extends Database
{
final static String jdbcDriver = "org.firebirdsql.jdbc.FBDriver";
final static String jdbcProtocolPrefix = "jdbc:firebirdsql://";
final static String dbName = "localhost/C:/OP2/OP7/Aristarcus.GDB";

public AristarcusDatabase(String user, String passwd)
throws PersistenceException
{
super(jdbcDriver, jdbcProtocolPrefix + dbName, "SYSDBA", "masterkey");
registerPersister(Author.class, new AuthorPersister());
registerPersister(Paper.class, new PaperPersister());
//registre os demais persisters
}

to insert...

synchronized public void insert(Transaction t, Persistent p)
throws PersistenceException
{
try
{
Database db = (Database)t.getObjectStore();
Author author = (Author)p;

String sqlQuery = ("INSERT INTO AUTHOR("+
"AuthorId, PersistentId, Formation, Name, Email, RG, CPF)" +
" VALUES (" + author.getId() + "," +
author.getId() + ",'" +
author.getFormation() + "','" +
author.getName() + "','" +
author.getEmail() + "','" +
author.getRG() + "','" +
author.getCPF() + "')");

db.executeQuery(sqlQuery);

thanks...

LEANDRO

> > I try to use Firebird and JDBC Jaybird to access a GDB file, but
> > when I try to insert a data in GDB I give a message:
> >
> > Resource Exception. Unrecognized transaction
> > Reason: Unrecognized transaction
> >
> > How can I resolv this??
>
> Should not happen in normal case. Please post the code you use and the
full
> stack trace.
>
> Roman