slide1 n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
JDBC PowerPoint Presentation
Download Presentation
JDBC

Loading in 2 Seconds...

play fullscreen
1 / 6

JDBC - PowerPoint PPT Presentation


  • 91 Views
  • Uploaded on

JDBC. JDBC Drivers. JDBC is an alternative to ODBC and ADO that provides database access to programs written in Java. Java Servlet and Applet. An applet is a compiled, machine-independent, Java bytecode program that is transmitted to a browser via HTTP and is invoked using the HTTP protocol

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'JDBC' - tyrone-mooney


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
jdbc drivers
JDBC Drivers
  • JDBC is an alternative to ODBC and ADO that provides database access to programs written in Java
java servlet and applet
Java Servlet and Applet
  • An applet is a compiled, machine-independent, Java bytecode program that is transmitted to a browser via HTTP and is invoked using the HTTP protocol
  • A servlet is a Java program that is invoked on the server to respond to HTTP requests
  • Type 3 and Type 4 drivers can be used for both applets and servlets
  • Type 2 drivers can be used only in servlets
using jdbc
Using JDBC

1. Load the driver

  • The driver class libraries need to be in the CLASSPATH for the Java compiler and for the Java virtual machine
  • Class.forName(string).newInstance();

2. Establish a connection to the database

  • Connection conn = DriverManager.getConnection(string);
  • A connection string includes the literal jdbc:, followed by the name of the driver and a URL to the database
using jdbc cont
Using JDBC (cont.)

3. Create a statement

    • Statement stmt = conn.createStatement();

4. Execute the statement

    • ResultSet rs = stmt.executeQuery(querystring);
    • Int result = stmt.executeUpdate(updatestring);
    • ResultSetMetaData rsMeta = rs.getMetaData();
  • Both compiled queries and stored procedures can be processed via JDBC using PreparedStatement and CallableStatement objects