• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Jsp + My Sql
 

Jsp + My Sql

on

  • 1,165 views

A simple walthrough to connect JSP with MySql Database.

A simple walthrough to connect JSP with MySql Database.

Statistics

Views

Total Views
1,165
Views on SlideShare
1,107
Embed Views
58

Actions

Likes
0
Downloads
51
Comments
0

2 Embeds 58

http://www.cekerz.com 56
http://www.slideshare.net 2

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Jsp + My Sql Jsp + My Sql Presentation Transcript

    • JSP to create usable apps. A fun way + MySQL
    • THE BASICS • What is JSP? • What is JDBC? • What is ODBC?
    • What Exactly is JDBC? • JDBC is an API for the Java programming language that defines how a client may access a database. It provides methods for querying and updating data in a database. JDBC is oriented towards relational databases. Servlet JDBC ODBC DB
    • How do we do that???
    • Loading the JDBC Driver • We should have the Driver!!! • MySQL Connector/J - version 2 used for this tutorial Download Link : http://dev.mysql.com/downloads/connector/j/ • Copy it to the “lib” folder in the server.
    • Loading the JDBC Driver • To load the driver you only need to load the appropriate class. • Syntax : Class.forName(“fully qualified class name”) • For MySQL : Class.forName(“com.mysql.jdbc.driver”)
    • Defining the connection URL • Driver is ready to go..But where??? • Define a connection URL which specifies the SERVER & the Database needed • “jdbc:mysql://localhost:3306/db_name”
    • Establishing the connection • The actual network connection!! • Connection conn=DriverManager.getConnection(“Connection URL”,”user”,”pass”);
    • Creating the statement Object • Statement stmt = conn.createStatement(); • Statement Object sends queries and commands to the database.
    • HOW EXACTLY DOES ALL THIS WORK??? LIVE DEMO