Hi, Folks:
I meet some problem that I always get the exception
"informix.api.DBServerException: XIX000:-106:ISAM error: non-exclusive access."
when I try to drop the table. I believe what I do is really simple, but I
really can't find where is my problem at all. Does anyone know where the problem
is? The problem is described briefly as follows:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Everthing work fine except that if I select data from table
and then drop it. The error message "non-exclusive" will apear,
and the table still exist.... And so I guess the problem comes from
select part,but I have no idea about it.....
//IDE: VisualCafe 4
//LANGUAGE: Java
import informix.api.*;
import informix.api.remote.rmi.*;
//connecton method
import informix.api.*;
import informix.api.remote.rmi.*;
Connection conn;
Query query;
Credentials cred;
try{
cred = new RMICredentials(appServer, db, user, sys, passwd);
conn = cred.connection();
query = conn.query();
}catch (Exception exec){;}
try{
conn.open();
}catch (Exception exec){;}
// create table
String Create_qry = new String("CREATE TABLE e (img_id integer);");
try{
if (!query.execForStatus(Create_qry))
;
}catch (DBException dbexc){;}
// insert data into table
String insert_qry = "insert into e (img_id) values(9);";
try{
if (query.execForStatus(insert_qry)==false)
;
}catch (DBException dbexc){;}
<!-- the problem will appear everytime when I execute the code below -->
// retireve data from table
Row row;
String select_qry = new String("select img_id from e;");
try{
if (!query.execForIteration(select_qry))
System.out.println("Could not excute select_from_temp_qry!");
while ((row = query.nextRow()) != null)
{
;
}
}
catch (DBException dbexc){;}
<!-- end -->
// delete data in table
String Delete_qry = new String("delete from e where img_id<>0;");
try{
if (!query.execForStatus(Delete_qry))
;
}catch (DBException dbexc){;}
// drop table
String Drop_qry = new String("DROP TABLE e;");
try{
if (!query.execForStatus(Drop_qry))
;
}catch (DBException dbexc){;}
thanks a lot!
Joe