steps required to execute a query in JDBC

steps required to execute a query in JDBC

What are the steps required to execute a query in JDBC?

View Answers

November 9, 2010 at 5:30 PM

  1. create an instance of a JDBC driver or load JDBC drivers,
  2. register driver with DriverManager class.
  3. open a connection.
  4. create a statement
  5. execute the query.

November 12, 2010 at 11:36 AM

Hi friends,

The steps requires to execute a query in JDBC.

1 : First of all, we need to create an instance of a JDBC driver or load JDBC drivers.
2 : In the second step, we need to register the driver with DriverManager class.
3 : In this step, open the connection.
4 : With the help of this connection , creates a statement object.
5 : Execute the SQL queries.
6 : Close connection.

Thanks.









Related Tutorials/Questions & Answers:
steps required to execute a query in JDBC
steps required to execute a query in JDBC  What are the steps required to execute a query in JDBC
JDBC Execute Query
JDBC Execute Query       The  Execute Query in JDBC retrieve the elements from a database. In this Tutorial we want to describe you a code that helps you to understand JDBC Execute Query
Advertisements
query in JDBC
query in JDBC  What are the steps required to execute a query in JDBC
JDBC Execute Update Example
JDBC Execute Update Example       JDBC Execute Update query is used to modify or return you an integer value specify... a simple example from JDBC Execute update Example. In this Tutorial we want
what are the steps in jdbc?
what are the steps in jdbc?  what are the steps in jdbc
JDBC Steps ? Basic steps in writing a JDBC Application
JDBC Steps – Basic steps in writing a JDBC Application... you brief description of JDBC Steps for making connection with the database.... Here are the JDBC Steps to be followed while writing JDBC program
HQL Query in execute method of Struts2
HQL Query in execute method of Struts2  I am making login page... data from database using hql. And where I need to write the hql query. Is it possible to write it at execute method of struts2
jdbc query
jdbc query  write a query of how to print the values of any column present in database in reverse order
JDBC Execute Statement
JDBC Execute Statement       JDBC Execute Statement is used to execute SQL Statement, The Execute... a database. In this Tutorial, the code illustrates an example from JDBC Execute
Query On JDBC - JDBC
Query On JDBC  Hello , I am trying to migrate from xls TO mysql in Linux platform.. I'm using JDBC ODBC Bridge Driver..String url = "jdbc:excel:./personal1.xls";System.out.println
jdbc query
jdbc query  hello sir I have used your simple bank application project in my project to display transaction details but i am using ms access data base but when i am trying to display transaction details i will show the datatype
jdbc query
jdbc query  hello sir I have used your simple bank application project in my project to display transaction details but i am using ms access data base but when i am trying to display transaction details i will show the datatype
jdbc query
jdbc query  hello sir I have used your simple bank application project in my project to display transaction details but i am using ms access data base but when i am trying to display transaction details i will show the datatype
jdbc query
jdbc query  hello sir I have used your simple bank application project in my project to display transaction details but i am using ms access data base but when i am trying to display transaction details i will show the datatype
could not execute native bulk manipulation query
could not execute native bulk manipulation query  I am insert data... public ActionForward execute(ActionMapping mapping, ActionForm form... = "insert into emp values(?,?,?,?,?)"; SQLQuery query
JDBC connection and SQL Query - JDBC
each time. Now I'm trying to execute a query to insert those values into an oracle...JDBC connection and SQL Query  Hi, I'm reading a all files one... variables. I'm trying to execute following command. Though I use executeQuery
Query regarding JSP, JDBC
Query regarding JSP, JDBC  can I get the code for the question asked by me regarding JSP,JDBC
How to execute mysql query based on checkboxes values in java swing application.
How to execute mysql query based on checkboxes values in java swing... have to execute query based on selection of checkboxes.Means I have to to execute query acording to the checkbox. whichever checkbox is selected query should
How to execute mysql query based on checkboxes values in java swing application.
How to execute mysql query based on checkboxes values in java swing... have to execute query based on selection of checkboxes.Means I have to to execute query acording to the checkbox. whichever checkbox is selected query should
How to execute mysql query based on checkboxes values in java swing application.
How to execute mysql query based on checkboxes values in java swing... have to execute query based on selection of checkboxes.Means I have to to execute query acording to the checkbox. whichever checkbox is selected query should
JDBC related query
JDBC related query  How to merge two resultset of two different queries, wherein both the resultset(after query execution)gives an integer value as its column
use JDBC to execute non-standard features that my DBMS provides.
use JDBC to execute non-standard features that my DBMS provides.  Can I use JDBC to execute non-standard features that my DBMS provides
Execute database query by using sql tag of JSTL SQL library
Execute database query by using sql tag of JSTL SQL library... to create application that execute sql query given by user using JSTL SQL Library. To execute query first create a data source and then execute sql query
How to execute my query fast..When A date filter is there in a query it takes more time for execution.?
How to execute my query fast..When A date filter is there in a query it takes more time for execution.?  When A date filter is there in a query... in 30 seconds with 5000 records... what is the problem ... how to execute my query
JDBC Components
JDBC Components    Jdbc has following components-- 1.  JDBC API      Using  JDBC API ,frontend java applications can execute query and fetch data from connected database. JDBC API can also
sql query - JDBC
sql query  I need a SQL query to add data into database
SQL QUERY - JDBC
SQL QUERY  I m running a query using apache tomcat the sql query is on adding an employee in the database whenever i click on add after inserting the values i am getting a java.lang.nullpointer exception
Query regarding JSP, JDBC
Query regarding JSP, JDBC  I have a table in SQL Server database storing some ids and names. In my jsp code a while loop is displaying the list... by running a query through the id corresponding the name using arraylist
query related to jdbc
query related to jdbc  hello, i have done my database connection successfully ie db2 with RAD. but while running my application i am not able to fetch the data so please suggest and help me
What is the return type of execute mehtod in jdbc - Java Beginners
. My interview asked wat is return type of execute() in jdbc . should...What is the return type of execute mehtod in jdbc  Hi Deepak, u... java.sql.Statement or java.sql.PreparedStatement or java.sql.CallableStatement, the execute
JDBC- SQL spatio-temporal query
JDBC- SQL spatio-temporal query  Any one give me a JDBC sql query for my spatio temporal query? Trajectory table OBJID PLACE 7 H 8 Q 9 W 10... as shown in above. I want a spatio-temporal query using JDBC-SQL to retrieve
JDBC- SQL spatio-temporal query
JDBC- SQL spatio-temporal query  Any one give me a JDBC sql query for my spatio temporal query? Trajectory table OBJID PLACE 7 H 8 Q 9 W 10... as shown in above. I want a spatio-temporal query using JDBC-SQL to retrieve
The required JDBC drivers to establish connectivity to my database part of the JDK.
The required JDBC drivers to establish connectivity to my database part of the JDK.  Are all the required JDBC drivers to establish connectivity to my database part of the JDK
How to connect to MySql Database from Servlet?
will learn the JDBC steps necessary to connect to the MySQL Database and execute the query.  Here we are using the MySQL jdbc driver for making the connection. You can download the jdbc driver for MySQL from http://dev.mysql.com
hi, Everyone ,i'm learning jdbc, i got an nullpointerexception when execute this program.
hi, Everyone ,i'm learning jdbc, i got an nullpointerexception when execute this program.   ConnectionProvider.java import java.util.*; import... class=oracle.jdbc.driver.OracleDriver url=jdbc:oracle:thin:@localhost:1521:xe user
Java Multiple Insert Query
Java Multiple Insert Query In this example we will discuss about how to execute multiple insert query in Java. This example explains you about how to execute batch insert in Java. This example explains all the steps for executing
MySQL PHP Query delete
;  Mysql PHP Query delete is used to execute Mysql function... a table 'MyTable' that has the required fieldnames and datatypes respectively. Query... into MyTable values(07,'Q','26000'); Query OK, 1 row affected (0.01 sec
PHP SQL Query Insert
PHP SQL Query Insert       This example illustrates how to execute insert query in php...). Now, queries can be executed using mysql_query() method to insert values
JDBC
JDBC  How to add set of queries in a single query in JDBC
Php Sql Query Insert
Php Sql Query Insert  This example illustrates how to execute insert query with values in php application. In this example we create two mysql query...; mysql_query("INSERT INTO users (username, password
can i insert values into two tables by a query - JDBC
can i insert values into two tables by a query  hi all, can i insert values into two tables by a query Thanks Bala k
PHP SQL Query Where Clause
PHP SQL Query Where Clause       This example illustrates how to create and execute the sql query with where clause. To understand how to display the result returned 
Executing Prepared Statement
-compiled query with parameter and no-parameter. An example given below... = "jdbc:mysql://localhost:3306/student"; String userName = "root"; String... = ptmtExample.getConnection(); // Writing a query String query = "SELECT * FROM student
MySQL PHP Query delete
;  Mysql PHP Query delete is used to execute Mysql function... 'MyTable' that has the required fieldnames and datatypes respectively. Query... into MyTable values(07,'Q','26000'); Query OK, 1 row affected (0.01 sec
JDBC - JDBC
)write query and execute the query: ResultSet rs = st.executeQuery("SELECT...JDBC  how can i do jdbc through oracle.. pls if u can send me d.... thanking u santosh.  Hi Friend, Use JDBC with Oracle Follow
Steps not found.
Steps not found.  import java.io.*; import java.net.*; import javax.servlet.*; import javax.servlet.http.*; public class Details1 extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse
jdbc - JDBC
: Statement st = conn.createStatement(); b)write query and execute the query...jdbc   kindly give the example program for connecting oracle dase using oracle thin driver   Hi Friend, Follow these steps: 1) Import
jdbc - JDBC
JDBC Query to Connect Database  JDBC Query to connect to database  will u supply me the block of code where it throws the exception
Sitemap JDBC Tutorial Section
Code In Java | JDBC Drive For Mysql | JDBC Execute Query | JDBC Execute... | Connection Object in JDBC | Steps to writing JDBC Applications    ... Clob Data | GET DATE in JDBC | Create table and insert data by sql query
code required.!
Java Script phone number entered by person should be in numeric only. code required!  i am using javascript coding on jsp page. i want that the phone number entered by person should be in numeric only..can i get code

Ads