1.

Is Possible To Open A Connection To A Database With Exclusive Mode With Jdbc?

Answer»

I think you mean "lock a table in exclusive mode". You cannot OPEN a connection with exclusive mode. Depending on your database engine, you can lock tables or rows in exclusive mode.

In Oracle you would create a statement ST and run
st.execute("lock table mytable in exclusive mode");

Then when you are finished with the table, execute the commit to unlock the table. MYSQL, Informix and SQLServer all have a slightly different syntax for this function, so you'll have to change it depending on your database. But they can all be DONE with execute().

I think you mean "lock a table in exclusive mode". You cannot open a connection with exclusive mode. Depending on your database engine, you can lock tables or rows in exclusive mode.

In Oracle you would create a statement st and run
st.execute("lock table mytable in exclusive mode");

Then when you are finished with the table, execute the commit to unlock the table. Mysql, Informix and SQLServer all have a slightly different syntax for this function, so you'll have to change it depending on your database. But they can all be done with execute().



Discussion

No Comment Found