ImageVerifierCode 换一换
格式:PPT , 页数:25 ,大小:75KB ,
资源ID:372955      下载积分:2000 积分
快捷下载
登录下载
邮箱/手机:
温馨提示:
如需开发票,请勿充值!快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝扫码支付 微信扫码支付   
注意:如需开发票,请勿充值!
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【http://www.mydoc123.com/d-372955.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(Java and Databases.ppt)为本站会员(lawfemale396)主动上传,麦多课文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知麦多课文库(发送邮件至master@mydoc123.com或直接QQ联系客服),我们立即给予删除!

Java and Databases.ppt

1、Java and Databases,CS-328 Dick Steflik,Database Drivers,Think of a database as just another device connected to your computer like other devices it has a driver program to relieves you of having to do low level programming to use the database the driver provides you with a high level api to the data

2、base,ODBC,Open Data Base Connectivity Developed by Microsoft for the Windows platform as the way for Windows applications to access Microsoft databases (SQL Server, FoxPro, Access) Has become an industry standard Most data base vendors supply native, odbc, and jdbc drivers for their data base produc

3、ts,JDBC Architecture,Java Application,JDBC API,Data Base Drivers,Access,SQLServer,DB2,Informix,MySQL,Sybase,JDBC Driver Types,Type 1JDBC-ODBC Bridge Type 2 Native API, partially java Type 3 JDBC Network Driver, partially java Type 4 100% Java,Type 1 Drivers,Translate JDBC into ODBC and use Windows O

4、DBC built in drivers ODBC must be set up on every client driver must be physically on each machine for both java applications and applets for server side servlets ODBC must be set up on web server driver sun.jdbc.odbc.JdbcOdbc provided by JavaSoft with JDK,Type 1 Driver (cont.),Client,JDBC-ODBC,ODBC

5、,DB,Vendor Library,Type 2 Drivers,Converts JDBC to data base vendors native SQL calls like Type 1 drivers; requires installation of binaries on each client,Type 2 Drivers (cont.),Client,JDBC,Vendor Library,DB,Type 3 Drivers,Translates JDBC to a DBMS independent network protocol Typically talks direc

6、tly with a middleware product which in turn talks to the RDBMS Jaguar, DBAnywhere, SequeLink Most flexible driver type all java,Type 3 Drivers (cont.),Client,JDBC,Vendor Middleware,DB,Tier 1,Tier 2,Tier 3,Type 4 Drivers,Converts JDBC directly to native API used by the RDBMS compiles into the applica

7、tion , applet or servlet; doesnt require anything to be installed on client machine, except JVM handiest driver type,Type 4 Drivers (cont.),Client,JDBC,DB,Structured Query Language,Developed by C. Date for Relational Data Base Management Systems (RDBMS) Simple Declarative Language has no program con

8、trol statements,SQL,Two categories of commands Data Manipulation Commands deal with: RETRIEVING DATA MAINTAINING DATA (ADDING, UPDATING,DELETING Data Definition Commands DEAL WITH: CREATING DATABASE OBJECTS (TABLES,VIEWS) Object organization and attributes,Referential Integrity,Rules to insure that

9、table data stays accurate and accessible rows in a table should be unique one column should contain no duplicate data primary key column values cannot contain repeating groups or arrays null is different than space and zero, 2 null values are not considered equal,Data Manipulation Commands,Select -

10、query and display data from a database Insert - a new row into a table Update - modify a column in a table Delete a row from a table,Select,Select (column list) from (sources) where (conditions) order by (ocolumn list) column list - comma separated list of names of columns to be in output Ex. ssn ,

11、lastname , firstname,gpa can contain literals to be included in output Ex. Ssn,”,lastname,”,firstname sources - name(s) of table(s) to retrieve data from conditions (optional) - conditions for selections lastname like “S%” (lastname = “Steflik) and (firstname like “R%”) ocolumn list (optional)- list

12、 of columns that output should be ordered by Ex select * from student select lastname,fristname from student where gpa 3.0 select lastname,firstname from student order by lastname,firstname,Select - joined tables,Two tables may be joined and viewed as a single data source is the both have a common c

13、olumn suppose we have 2 tables: Inventory and category and each has a column called catg_code In category catg_code is unique and is the primary key,Select - joined tables (cont.),P_no,Catg_code,qty,Catg_code,descr,Inventory,Category,join,Select - joined tables (cont.),To retrieve all of the part nu

14、mbers and the name of the category to which the part belongs: select inventory.p_no category.descr from inventroy , category select a.p_no,” “,b.descr from a inventory , b category,Insert,Add a row to a table insert into category values(“IGN”,”Ignition System”) use jdbc execute Update method ex. Stm

15、t.executeUpdate(“insert into Category values(IGN,Ignition System)”);,Update,Modify an existing row in a table update category set descr = “Ignition Subsystem” where catg_code = “IGN” Use jdbc executeUpdate method String s = “update category set descr = Ignition Subsystem where catg_code = IGN ”; stm

16、t.executeUpdate(s);,Delete,Remove a row from a table delete from category where catg_code = “IGN” remove the IGN category delete from category where catg_code like “I%” remove all rows where catg_code starts with an “I”,Data Definition Commands,Create table add a table to a database Drop Table remove a table from a database Alter Table add or delete column(s),

copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
备案/许可证编号:苏ICP备17064731号-1