Chapter4_JDBC_PartIII

13
UNIT- IV CHAPTER IN BOOK- 4 JDBC PART- III -K. Indhu

description

jdbc

Transcript of Chapter4_JDBC_PartIII

Page 1: Chapter4_JDBC_PartIII

UNIT- IVCHAPTER IN BOOK- 4

JDBCPART- III

-K. Indhu

Page 2: Chapter4_JDBC_PartIII

SYLLABUS COVERED HERE• Installing and setting up JDBC

Page 3: Chapter4_JDBC_PartIII

GOALS1. Installing JDBC – 12. Installing JDBC – 23. Installing JDBC – 34. Installing JDBC – 45. Installing JDBC – 56. Installing JDBC – 6

Page 4: Chapter4_JDBC_PartIII

INSTALLING JDBC- I1. DATABASE SOFTWARE=>• Firstly, we need a Database Software Package, that is

compatible with JDBC.

Let’s take MS- Access for our Current Syllabus.

2. DATABASE TO BE CREATED IN DATABASE SOFTWARE=>• Secondly, we need to create a database using the

Database Software Package.

Let’s create a Database in MS- Access called “SASTRA”.

Page 5: Chapter4_JDBC_PartIII

INSTALLING JDBC- 23. ADMIN PERMISSIONS(PRIVILEGES) TO CREATE/UPDATE/DROP

TABLE IN DATABASE=>• Thirdly, we should get appropriate permissions needed to be

able to create, update and drop tables.

Being owner of your laptop you would have Admin Privileges to Create a Table in the created Database.

4. CREATE TABLE IN DATABASE & INSERT DATA=>• Fourthly, we should create a Table in Database using “create

Table” statement (OR) USING EDITOR.

Let’s create a Table- “Students” under “SASTRA” Database in our MS- Access.

Page 6: Chapter4_JDBC_PartIII

INSTALLING JDBC- 2

Page 7: Chapter4_JDBC_PartIII

INSTALLING JDBC- 2

Page 8: Chapter4_JDBC_PartIII

INSTALLING JDBC- 35. JDBC – ODBC BRIDGE DRIVER IN JDK-1.7 (OR) BELOW VERSIONS OF

JDK=>• Fifth, we would use JDBC-ODBC Bridging Driver available in JDK 1.7

or below versions for Connecting MS-Access to Java Application.

NOTE-> YOUR SYSTEM/LAPTOP SHOULD NOT HAVE JDK ABOVE THAN 1.7 VERSIONS LIKE- 1.8.

6. JAVA APPLICATION (CLIENT) TO BE DEVELOPED=>• Sixth, we should write a Java Class containing-• public static void main(String args[]) {………}

As below->E:\JavaPrograms\

MyPracticeExercises\JDBC\

Page 9: Chapter4_JDBC_PartIII

INSTALLING JDBC- 47. IN CONTROL PANEL -> ADMINISTRATIVE TOOLS -> DATA SOURCES

(ODBC)=> Seventh, we would go to Control Panel -> Administrative Tools -> Data

Sources(ODBC) -> ODBC Window will be opened.

Page 10: Chapter4_JDBC_PartIII

INSTALLING JDBC- 58. IN DATA SOURCES (ODBC) CREATE A DSN UNDER “SYSTEM” TAB=> Eighth a DSN should be Created in ODBC as below->

Page 11: Chapter4_JDBC_PartIII

INSTALLING JDBC- 69. COMPILE & RUN JAVA APPLICATION=> Ninth Compile cum Run your Java Applet / Application as below & GET

OUTPUT OF JDBC PROGRAM->

Page 12: Chapter4_JDBC_PartIII

K. INDHU

SO FAR WE STUDIED…• Installing and setting up JDBC

Page 13: Chapter4_JDBC_PartIII

HAPPY LEARNING!!!