I'm trying to do the simplest thing, an insert using the latest JDBC 3.0 jar. Below is what I have in my test class. What is happening is that the row is created in Access but it contains no data. Other tables are not showing this problem with inserts, and when I test using the Sun JDBC-ODBC bridge, the data is there in Access as it should be. I am quite mystified. I have tried to upload the database to your FTP server as previously instructed (called tables.mdb), but I am getting an error as the uplaod completes (can't write to the file). Maybe you do in fact have the file, in which case maybe you could test out the problem.
Class.forName("com.hxtt.sql.access.AccessDriver").newInstance();
String url = "jdbc:access:////windows_d/projects/rainbow-epos/tables.mdb";
java.sql.Connection c = DriverManager.getConnection(url, "", "");
c.setAutoCommit(false);
c.setReadOnly(false);
java.sql.Statement st = c.createStatement();
st.execute("DELETE FROM PLUStock");
st.execute("INSERT INTO PLUStock (PLUCode) VALUES ('123456')");
c.commit();
|
Passed test with the following code. Because I haven't seen your upload file so that I used a simulative mdb files. I think that the key is your tables.mdb file. You can zip and upload your backup database and corrupted database into:
ftp site: ftp.hxtt.com
ftp user: anonymous@hxtt.com
ftp password: (empty)
login mode: normal (not anonymous)
ftp port:21
upload directory: incoming
transer mode: binary (not ASCII)
After upload, you can't see that upload file, but it has been upload.
You can choose to zip and email it to webmaster.hxtt@gmail.com too.
import java.sql.*;
import java.util.Properties;
public class testTrans8 {
public static void main(String argv[]) {
try {
Class.forName("com.hxtt.sql.access.AccessDriver").newInstance();
// String url = "jdbc:access:////windows_d/projects/rainbow-epos/tables.mdb";
String url = "jdbc:access:////mdbfiles/tables.mdb";
Properties props = new Properties();
java.sql.Connection c = DriverManager.getConnection(url, "", "");
c.setAutoCommit(false);
c.setReadOnly(false);
java.sql.Statement st = c.createStatement();
st.execute("DELETE FROM PLUStock");
st.execute("INSERT INTO PLUStock (PLUCode) VALUES ('123456')");
c.commit();
c.close();
}
catch (SQLException sqle) {
do {
System.out.println(sqle.getMessage());
System.out.println("Error Code:" + sqle.getErrorCode());
System.out.println("SQL State:" + sqle.getSQLState());
sqle.printStackTrace();
}
while ( (sqle = sqle.getNextException()) != null);
}
catch (Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
}
}
}
|
I have e-mailed the zipped mdb file to the address mentioned above.
|
Thanks. Recurred and fixed a bug:
v2.0.041 fixed a bug for insert very long data into JET3 version database.
v2.0.041 supports fully ALTER TABLE sql.
v2.0.041 supports DROP INDEX sql.
You can download it after about 2 hours.
|
I'll check it out. I'm impressed by the level of support here - let's hope I can dispense with the JDBC-ODBC bridge very soon!
|
No, the bug is still there. Please try again with the tables.mdb.zip I just sent to webmaster.hxtt@gmail.com. No error is returned, and a row is inserted into PLUStock, but there is no data in the row (the column 'PLUCode' is empty, where it should contain '123456').
|
Here's something helpful I just discovered: the problem does not occur if I convert the database to JET4. Unfortunately I am not able to do this for the real system, which has to work with JET3 databases.
|
You download it at 08:16, but it's updated at 09:35:) Please redownload it:) Thanks for your valuable response:)
|
>Here's something helpful I just discovered: the problem does not occur if I
> convert the database to JET4. Unfortunately I am not able to do this for the
> real system, which has to work with JET3 databases.
Yeah. It's a fixed bug for insert very long data into JET3 version database sometimes.
|
Looks like it's fixed, thanks. I'll let you know.
|