JDBC的步骤
来源:互联网 发布:wp 主题引入js函数 编辑:程序博客网 时间:2024/05/01 12:30
<!-- /* Font Definitions */ @font-face {font-family:宋体; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-alt:SimSun; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 680460288 22 0 262145 0;}@font-face {font-family:"/@宋体"; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 680460288 22 0 262145 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; text-align:justify; text-justify:inter-ideograph; mso-pagination:none; font-size:10.5pt; mso-bidi-font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:宋体; mso-font-kerning:1.0pt;} /* Page Definitions */ @page {mso-page-border-surround-header:no; mso-page-border-surround-footer:no;}@page Section1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin:36.0pt; mso-footer-margin:36.0pt; mso-paper-source:0;}div.Section1 {page:Section1;}-->
1. 加载某个数据库的驱动(Driver类),通常使用Class.forName(“驱动的类名“);
2. 连接数据库――
Connection con = DriverManager.getConnection(url,username,password);
3. 得到会话――Statementstmt = con.createStatement();
4. 执行操作――Resultrs = stmt.executeQuery(“SQL查询语句”);
5. 处理结果――
while(rs.next()){
String col1 = rs.getString(1);
……
}
简单吧!整个JDBC中可以变化的一般是:
1. 可以由Connection对象创建Statement、PreparedStatement和CallableStatement创建三种类型的Statement。
2. 可以创建多种类型的ResultSet:支持单向移动和个自由移动;可更新的和不可更新的;支持不同等级的交易的…..
3. 数据输入的批处理。
4. 结果集中特殊类型(Blob、Clob、Arrary和Ref、Struct)列的操作。
5. 这些特殊类型的录入数据库。
6. javax.sql包中特殊结果集(CachedRowSet、JdbcRowSet、WebRowSet)的操作。
7. 其它的就是一个DataSource了,也很简单!一个J2EE中的被管理对象
- JDBC的步骤
- JDBC编程的步骤
- JDBC编程的步骤
- JDBC编程的步骤
- JDBC编程的步骤
- JDBC的使用步骤
- jdbc的编程步骤
- JDBC的连接步骤
- jdbc的编程步骤
- JDBC的操作步骤
- JDBC总结02-JDBC 编程的步骤
- JDBC应用程序的基本步骤
- JDBC连接数据库的步骤
- JDBC访问数据库的步骤
- JDBC连接数据库的步骤
- jdbc连接数据库的步骤
- jdbc连接数据的步骤
- JDBC连接数据库的步骤
- C#结构体和字节数组的转换
- 测试 ASP.NET WebService 工具 SoapUI
- Grid数据源动态变化
- 网站推广常用的29个方法
- 治疗颈椎痛
- JDBC的步骤
- ext开发程序布局
- SWI指令---软件中断实例详解
- 直接用EditPlus作为Firefox“查看页面源代码”工具后的BUG
- 吴全:究竟什么是全业务运营?
- java socket 发送接收文件实例
- 金鼎福软件:主力匀速建仓有迹可循
- 在Linux上安装Oracle数据库11gR1
- 安装错误 Fatal error: Mage_Core_Model_Session_Abstract::getMessages()