Note13-DBProgramming0

Note13-DBProgramming0 - CSc134 DatabaseManagementand...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
1 CSc 134 Database Management and  File Organization 12. Introduction to Database  programming Ying Jin Computer Science Department California state University, Sacramento
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Database Programming How to interact with a DBMS? Interactive interface provided by DBMS. More? Objective: to access a database from  an application program  A majority of database operations are  made through application programs  e.g. web applications
Background image of page 2
3 Database Programming  Approaches Embedded SQL SQLJ JDBC PHP to MySQL
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 JDBC
Background image of page 4
5 Java Database Connectivity JDBC: SQL connection function calls for  Java programming A Java program with JDBC functions  can access any relational DBMS that  has a JDBC driver Architecture
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 Steps in JDBC Database Access Set up environment  Make sure you include the driver in your classpath Import Java sql package  (import java.sql.*) Register JDBC driver DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver()); Connecting to the database Connection conn =  DriverManager.getConnection(urlStr,username,password); Querying the Database 
Background image of page 6
7 JDBC Statement Statement stmt = conn.createStatement(); ResultSet rs=null; rs=stmt.executeQuery("select * from 
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/26/2009 for the course CSC CSC 134 taught by Professor Jinyin during the Spring '09 term at CSU Sacramento.

Page1 / 14

Note13-DBProgramming0 - CSc134 DatabaseManagementand...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online