Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

is is possible to open a connection to a database with exclusive mode with JDBC?

0
10 Posted

is is possible to open a connection to a database with exclusive mode with JDBC?

0
10

Location: http://www.jguru.com/faq/view.jsp?EID=742017 Created: Jan 31, 2002 Author: Jay Meyer (http://www.jguru.com/guru/viewbio.jsp?EID=708650) Question originally posed by Fofana Mamadi (http://www.jguru.com/guru/viewbio.jsp?EID=505453 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().

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123