Subject Why can I read but not write?
Author maxtelfer
Hi all

I am using Windows XP, Tomcat 4.1.29 and Java.
The firebirdsql-full.jar file is in the conf folder.

I have performed a default installation of Firebird-

1. I can both read and write to my database with isql OK.
2. Using both Driver and the Connection Pool example approaches,
I can read using SELECT but cannot write with UPDATE, etc.

An extract based on the sample code in Jaybird doco follows.

The output yields:
In RNDS 1 sql= etc
In RNDS 2 sql= etc
In RNDS str='its correct value'
In RNDS 3 sql= etc

Whither the line In RNDS 4 ??


org.firebirdsql.pool.FBWrappingDataSource fbwds = new

fbwds.setPooling(true); // this turns on pooling for this data
source. Max and min must be set.
fbwds.setMinSize(5); // this sets the minimum number of connections
to keep in the pool
fbwds.setMaxSize(30); // this sets the maximum number of connections
that can be open at one time.

// Get a database connection
Connection con = null;
Statement statement = null;
ResultSet rs = null;
String sql = "";
con = fbwds.getConnection();
statement = con.createStatement();
catch (SQLException e)
System.out.println("getting new fbwds connection failed!
Error: "+e+"\n");
sql = "select * from RosterHeaderDetails'";
System.out.println("In RNDS 1 sql=" + sql);
rs = statement.executeQuery(sql);
System.out.println("In RNDS 2 sql=" + sql);
String str = rs.getString("IncludeLogo");
System.out.println("In RNDS str=" + str);
sql = "UPDATE RosterHeaderDetails SET IncludeLogo = '1'";
System.out.println("In RNDS 3 sql=" + sql);
rs = statement.executeQuery(sql);
System.out.println("In RNDS 4 sql=" + sql);