SlideShare a Scribd company logo
1 of 15
Жава
Технологи
Улаанбаатар Их Сургууль
Бэлтгэсэн: Багш Б.Ганзориг
Өгөгдлийн сантай холбох
 Эхлээд өгөгдлийн сангаа үүсгэнэ.
create database jdbc_test;
Өгөгдлийн сантай холбох
 3 field бүхий user нэртэй table
үүсгэе.
CREATE TABLE `jdbc_test`.`user` (`id` INT NOT
NULL ,`name` VARCHAR( 50 ) NOT NULL ,`mail`
VARCHAR( 50 ) NOT NULL) ENGINE = MYISAM ;
Өгөгдлийн сантай холбох
 Table-дээ өгөгдөл оруулна.
INSERT INTO user VALUES ( 1, "Ganzorig",
"bold.ganzorig@gmail.com" ) ;
Өгөгдлийн сантай холбох
Өгөгдлийн сантай холбох
 NetBeans IDE хэрэглэж байгаа бол
Project-доо MySQL JDBC Driver jar
файлыг нэмж өгнө. Үүний тулд
Project-ыхоо Libraries хэсэг дээр Right
Click хийгээд Add Library,MySQL
JDBC Driver сонгоод Add дарна.
Өгөгдлийн сантай холбох
Өгөгдлийн сантай холбох
Өгөгдлийн сантай холбох
Өгөгдлийн сантай холбох
 Одоо MySQL дээр үүсгэсэн өгөгдлийн
санруу хандаж өгөгдөл уншиж
харуулдаг програмын кодыг харуулъя
Өгөгдлийн сантай холбох
Өгөгдлийн сантай холбох
Өгөгдлийн сантай холбох
Өгөгдлийн сантай холбох
Өгөгдлийн сантай холбох
 Програмын үр дүн:

More Related Content

Viewers also liked

Data Access Layer как страховка на случай миграции СУБД
Data Access Layer как страховка на случай миграции СУБДData Access Layer как страховка на случай миграции СУБД
Data Access Layer как страховка на случай миграции СУБДCUSTIS
 
Work with my_sql_-_database_in_java
Work with my_sql_-_database_in_javaWork with my_sql_-_database_in_java
Work with my_sql_-_database_in_javaAsya Dudnik
 
Работа с БД в Java
Работа с БД в JavaРабота с БД в Java
Работа с БД в Javametaform
 
Database Connectivity with JDBC
Database Connectivity with JDBCDatabase Connectivity with JDBC
Database Connectivity with JDBCDudy Ali
 
Коллекции в Java
Коллекции в JavaКоллекции в Java
Коллекции в Javametaform
 
PostgreSQL и JDBC: выжимаем все соки
PostgreSQL и JDBC: выжимаем все сокиPostgreSQL и JDBC: выжимаем все соки
PostgreSQL и JDBC: выжимаем все сокиVladimir Sitnikov
 
Jdbc Dao it-slideshares.blogspot.com
Jdbc Dao it-slideshares.blogspot.comJdbc Dao it-slideshares.blogspot.com
Jdbc Dao it-slideshares.blogspot.comphanleson
 
Jdbc in servlets
Jdbc in servletsJdbc in servlets
Jdbc in servletsNuha Noor
 

Viewers also liked (20)

Pl lecture5
Pl lecture5Pl lecture5
Pl lecture5
 
Pl lecture8
Pl lecture8Pl lecture8
Pl lecture8
 
Pl lecture4
Pl lecture4Pl lecture4
Pl lecture4
 
Pl lecture2
Pl lecture2Pl lecture2
Pl lecture2
 
Data Access Layer как страховка на случай миграции СУБД
Data Access Layer как страховка на случай миграции СУБДData Access Layer как страховка на случай миграции СУБД
Data Access Layer как страховка на случай миграции СУБД
 
Work with my_sql_-_database_in_java
Work with my_sql_-_database_in_javaWork with my_sql_-_database_in_java
Work with my_sql_-_database_in_java
 
Работа с БД в Java
Работа с БД в JavaРабота с БД в Java
Работа с БД в Java
 
Database Connectivity with JDBC
Database Connectivity with JDBCDatabase Connectivity with JDBC
Database Connectivity with JDBC
 
Коллекции в Java
Коллекции в JavaКоллекции в Java
Коллекции в Java
 
Pl lecture1
Pl lecture1Pl lecture1
Pl lecture1
 
PostgreSQL и JDBC: выжимаем все соки
PostgreSQL и JDBC: выжимаем все сокиPostgreSQL и JDBC: выжимаем все соки
PostgreSQL и JDBC: выжимаем все соки
 
Access1
Access1Access1
Access1
 
Database Access With JDBC
Database Access With JDBCDatabase Access With JDBC
Database Access With JDBC
 
Jdbc Dao it-slideshares.blogspot.com
Jdbc Dao it-slideshares.blogspot.comJdbc Dao it-slideshares.blogspot.com
Jdbc Dao it-slideshares.blogspot.com
 
Data Access with JDBC
Data Access with JDBCData Access with JDBC
Data Access with JDBC
 
Jdbc in servlets
Jdbc in servletsJdbc in servlets
Jdbc in servlets
 
Jdbc in java
Jdbc in javaJdbc in java
Jdbc in java
 
Netbeans IDE & Platform
Netbeans IDE & PlatformNetbeans IDE & Platform
Netbeans IDE & Platform
 
JDBC Tutorial
JDBC TutorialJDBC Tutorial
JDBC Tutorial
 
3 database-jdbc(1)
3 database-jdbc(1)3 database-jdbc(1)
3 database-jdbc(1)
 

More from ganzorigb

Lecture graphic programming
Lecture graphic programmingLecture graphic programming
Lecture graphic programmingganzorigb
 
Lecture tread
Lecture treadLecture tread
Lecture treadganzorigb
 
Lecture file man prog
Lecture file man progLecture file man prog
Lecture file man progganzorigb
 
Lecture file and folder working
Lecture file and folder workingLecture file and folder working
Lecture file and folder workingganzorigb
 
Lecture hibernate
Lecture hibernateLecture hibernate
Lecture hibernateganzorigb
 
Lekts presentation10
Lekts presentation10Lekts presentation10
Lekts presentation10ganzorigb
 
Lekts presentation12
Lekts presentation12Lekts presentation12
Lekts presentation12ganzorigb
 
Lekts presentation9
Lekts presentation9Lekts presentation9
Lekts presentation9ganzorigb
 
Lekts presentation8
Lekts presentation8Lekts presentation8
Lekts presentation8ganzorigb
 

More from ganzorigb (18)

Lecture 1 2
Lecture 1 2Lecture 1 2
Lecture 1 2
 
Pl lecture3
Pl lecture3Pl lecture3
Pl lecture3
 
Lecture graphic programming
Lecture graphic programmingLecture graphic programming
Lecture graphic programming
 
Lecture tread
Lecture treadLecture tread
Lecture tread
 
Lecture file man prog
Lecture file man progLecture file man prog
Lecture file man prog
 
Lecture file and folder working
Lecture file and folder workingLecture file and folder working
Lecture file and folder working
 
Lecture hibernate
Lecture hibernateLecture hibernate
Lecture hibernate
 
Lec03
Lec03Lec03
Lec03
 
PL Lecture4
PL Lecture4PL Lecture4
PL Lecture4
 
PL Lecture3
PL Lecture3PL Lecture3
PL Lecture3
 
PL Lecture2
PL Lecture2PL Lecture2
PL Lecture2
 
PL Lecture1
PL Lecture1PL Lecture1
PL Lecture1
 
Lecture2
Lecture2Lecture2
Lecture2
 
Lecture1
Lecture1Lecture1
Lecture1
 
Lekts presentation10
Lekts presentation10Lekts presentation10
Lekts presentation10
 
Lekts presentation12
Lekts presentation12Lekts presentation12
Lekts presentation12
 
Lekts presentation9
Lekts presentation9Lekts presentation9
Lekts presentation9
 
Lekts presentation8
Lekts presentation8Lekts presentation8
Lekts presentation8
 

Lecture data base programming part3