open a connection to a database with exclusive mode with JDBC

open a connection to a database with exclusive mode with JDBC

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

View Answers

November 15, 2010 at 1:24 PM

Hi friends,

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().

Thanks.


November 15, 2010 at 1:24 PM

Hi friends,

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().

Thanks.









Related Tutorials/Questions & Answers:
open a connection to a database with exclusive mode with JDBC
open a connection to a database with exclusive mode with JDBC  Is possible to open a connection to a database with exclusive mode with JDBC
open a connection to a database with exclusive mode with JDBC
open a connection to a database with exclusive mode with JDBC  Is possible to open a connection to a database with exclusive mode with JDBC
Advertisements
Correctly Open and Close database connection
; } Completely Open and Close A Database Connection Database Connection... depends on database connectivity. Therefore it is very important to open and close database connections properly. If any database connection is open
Database Connection - JDBC
Database Connection  In java How will be connect Database through JDBC?  Hi Friend, Please visit the following link: http://www.roseindia.net/jdbc/jdbc-mysql/MysqlConnect.shtml Thanks
java database connection - JDBC
java database connection  sir i want to join my project with MS access database. i am making my project in netbeans.please tell me the coding to do... the data into the MS Access database and retrieve the data from the database table
REQ for connection b/w jdbc and oracle database
REQ for connection b/w jdbc and oracle database    REQ for connection b/w jdbc and oracle database    The Java classes to connect... (OCI or Thin) through the JDBC connection URL. Here are some connection URL
Database connection sql server 2005 - JDBC
Database connection sql server 2005  Hi all i am developing an application in struts and i need to connect database for that application using sql server 2005.. can anyone tell me how to make database connection ..plz help me
DataBase Connection
DataBase Connection  How to connect java and Oracle 10g? Tell me Jdbc connection
form text box connection with mysql database feild - JDBC
form text box connection with mysql database feild  Respected Sir, What is the coding to connect a form text box field with mysql database table field will you explain me with simple example.. thanking you.. 
Java Jdbc connection
Java Jdbc connection  What are the steps involved for making a connection with a database or how do you connect to a database
Connection to Database
database tables? Do I need to open one connection to each section? Thank you... I manually make a connection to MySQL database in my web pages? How joomla... is the code how I am connecting to MySQL: I am connection to MySQL database in 2
JDBC connection
JDBC connection  ![alt text][1]I got exception in Connecting to a MySQL Database in Java. The exception is ClassNotFoundException:com.mysql.jdbc.Driver wat is the problem
Problem with open connection - Hibernate
connected to the database by using JDBC(with same driver and url).Please tell me... open connection...Problem with open connection  Hi Team, I am running one
database connection
database connection  how to connect the jsp page with database
database connection
database connection  i wanted to no how to connect sqlite database through netbeans? is it posible to connect it to a database that is on a remote pc? thank you
database connection
database connection  hi all ready created database table using mysql database,employee payroll,attendance,employee details used database i need how to import and export excel file into database using jsp? pls help me any one
Java jdbc connection
Java jdbc connection  Does the JDBC-ODBC Bridge support multiple concurrent open statements per connection
connection pooling - JDBC
commands on a database. It open and maintain a database connection for each user. In JDBC connection pool, a pool of Connection objects is created... friend, A connection pool is a cache of database connections maintained
JDBC connection pooling
JDBC connection pooling  What is Connection pooling
jdbc connection
"); Connection con = (Connection) DriverManager.getConnection("jdbc:mysql://127.0.0.1...jdbc connection  How to Submit data????   <%-- view... { Class.forName("com.mysql.jdbc.Driver"); Connection con = (Connection
JDBC Database URLs
JDBC Database URLs In this Section, We will discuss about following topics : JDBC Database URL specify a JDBC driver name Connection to a database table JDBC Database URL JDBC Uniform resource locater or 'JDBC URL'
j2me jdbc connection - JDBC
j2me jdbc connection  hello, whn i m importing sql package in mine midlet(tried for both javax.sql.* and java.sql.*;)..itz nt accepting it... hw to get connected to database?????.... plz help me out
JAVA DATABASE CONNECTION WITH JTABLE
JAVA DATABASE CONNECTION WITH JTABLE  HOw To Load Database Contents From Access Database to JTable without using Vector
jdbc connection issues
jdbc connection issues  Hello. kindly pls help in this issue...i... in the database correspondingly. How pls tell me how connect these 11 forms and 11 tables with only one jdbc connection program...if possiable pls post a sample code
connection with database - JSP-Servlet
and the connection with the database using jsp code, I get exceptions that I have... with java code. Is there any other way to establish a connection with database in jsp... a connection with database. Plz reply. Thanks in advance...   Hi
JDBC Connection and Registration
JDBC Connection and Registration   How to create a JDBC connection..... :-)   JDBC MS Access Database Connectivity: Follow these steps: 1)Go... your java with jdbc code.. It will create table in MS access database. Here
database - JDBC
database  hai friend, yes i want to use java database connection in eclipse IDE. Thanks in advance
JDBC Connection Pool
pooling. What is JDBC Connection Pool? The database connection is expensive...JDBC Connection Pool In this section we will learn about JDBC Connection Pool and see how to use Apache DBCP for creating the database connection pool. We
Java-Connection Pool - JDBC
Java-Connection Pool  How can I create a connection pool. My database... is Weblogic 8. Which is the best approach to create a connection pool? ...{ public static void main(String[] args){ Connection con = null; String url
JDBC connection
JDBC connection       The JDBC connection implements a connection with database in front end application... we illustrates you JDBC url connection. The current Tutorial helps you
Open Source Database Connection Pools written in Java
Connection to jdbc - Java Beginners
Connection to jdbc  I need to populate a listbox in jsp with values from Postgresql JDBC. i used the following code... but its not working... can..., We have used Mysql database. Try the following code
J2ME with Database Connection - MobileApplications
J2ME with Database Connection  I'm using SonyEricssion Java ME SDk for CLDC with WTK2. Can u give me a sample program for Database Connection using MS-Access with MIDlet code
DataBase connection with sql - Struts
DataBase connection with sql  How to connect sql and send db error in struts? what are the tag should i code in struts-confic.xml
server database connection - JSP-Servlet
" in that case how we will get the database connection   Hi Friend...server database connection  sir generally we will connect to the database by using the following steps 1.Class.forName("sun.jdbc.odbc.JdbcOdbcDriver
open a bufferedwriter file in append mode - Java Beginners
open a bufferedwriter file in append mode  hi.. i jus want knw how to opena bufferedwriter file in append mode..  Hi friend, FileWriter The FileWriter is a class used for writing character files. This constructor
database connection in struts - Struts
database connection in struts  Connecting database in Struts  in my project 4 table 1.user register 2.login page 3.forgot password 4.welcome page. all in struts but i dont no how sql database connected in struts plz
My eclipse not showing mysql on database developement mode
My eclipse not showing mysql on database developement mode  when i am making simple hibernet -mysql connection after going window-other perspective-database developement new database created and right click on that folder new
Java-Connection Pool - JDBC
Java-Connection Pool  How can I create a connection pool. My database is MS SQL server 2000(username-sa, pwd-admin) and my application server is Weblogic 8. Which is the best approach to create a connection pool? Kindly help
jdbc connection to java program code - JDBC
jdbc connection to java program code  i want a simple java program that which communicates with oracle database like creating table,insert values and update records in database and show in program output? please take a simple
choosing best jdbc connection - JDBC
choosing best jdbc connection  among the four types of jdbc which one... is the best type of Jdbc JDBC Net pure Java Driver A native-protocol pure Java driver converts JDBC technology into the network protocol
Connection using Jdbc-odbc bridge Driver
Connection using JDBC-ODBC bridge driver JDBCExample.java... program, Jdbc-Odbc bridge driver create connection between java application and 'MSAccess database'. After creating connection it also execute query.ADS
connection
connection   how to make multiple database connection using jdbc
jdbc odbc connection
jdbc odbc connection  i need a program in java which uses a jdbc odbc connection   Hi, You can create odbc datasource on your windows computer and then access in your Java program.ADS_TO_REPLACE_1 Read the JDBC ODBC
database connection - SQL
-database connection in eclipse IDE? Thanks...database connection  hi friends, This is poornima i want to connect sql server to my eclipse editer how to connect and where i have to write code
Server DB connection - JDBC
at the same time but it looks like the java is only picking up the second database. One database is on my localhost and the other one is on server, I want to transfer the data from my localhost database to the database on the server. I have
Java Connection to Oracle database
Java Connection to Oracle database  HI I am ubable to connnect jdbc to Oracle database.i had gone to control panel >>Administrative... type properly and the Test Connection failed.So Kindly tell me what to type in TNS
Connection to database - Java Beginners
Connection to database   HI I have just Started working on a Project on Jsp We hve some JSP Pages & trying to connect to our Database . We are using SQL server 2000 ? We are not able to connect our database Tables
connection database error
connection database error  import java.awt.EventQueue; // import...{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection("jdbc:odbc:NWIND
java database connection
java database connection  package com.tsi.constants; public class Constant { public static final String DRIVER = "oracle.jdbc.driver.OracleDriver"; public static final String DBURL = "jdbc:oracle:thin

Ads