1.1、数据库驱动
这里的驱动的概念和平时听到的那种驱动的概念是一样的,比如平时购买的声卡,网卡直接插到计算机上面是不能用的,必须要安装相应的驱动程序之后才能够使用声卡和网卡,同样道理,我们安装好数据库之后,我们的应用程序也是不能直接使用数据库的,必须要通过相应的数据库驱动程序,通过驱动程序去和数据库打交道,如下所示:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVEAAAD9CAIAAACKvdM0AAAgAElEQVR4nO2daVRT99bGD4PMgzJPiqLMGIIIokRUxoCIGgRBQBCcQEAhggLKKFREQcKoVds6oKIiooI4IEhFGXr1Q+9t1121tr1tfXXZyba39Yrh/RAIGU6SE0g4Sc5+1vOhDWfce//+0zmJyAgIBCKSELwvAAQCTamAeRCIWALmQSBiCZgHgYglYB4EIpaAeRCIWALmQSBiaUqZ//33348fPx5ApZqYmSkrKyMgEIGlpq7uNH9+5u7dX3zxxVRiOEXMM5nMEydOGJuaLvTzSyguLmxpqXrQUzfQDwYT07X9jyvu3c04fiwofqO+gUFcfPzPP/88NTBOBfNv377dmJAw18U573xTw2dDYDCY01W9D/yio2fNmfPvf/97CniUOvNMJnNjQoK77wpG30PcgwsGy6w3FuSbW1r+8MMP0kZS6syfOHFiroszAA8Gi/SalJSly5YxmUypIild5n///XdjU1MY0oPBWFw30G9tZ3flyhWpUild5o8fP77Qzw/3UILB8uJNJcVe3t5SpVK6zAdQqQnFxbjHEQyWFx/tfTBNTe3169fSo1K6zJuYmRW2tOAeRzBYjjzb3v7OnTvSo1K6zCsrK1c96ME9iGCwHNnV2/vMmTPSo1K6zCMIUjfQj3sQwWA5spuPz0cffSRFKqV36BFgHgwW38A8GEwsA/NgMLEMzIPBxDIwDwYTy8A8GEwsA/MKagYNQRAb+lX8rwQHV1MQBEFIEa24X4ksGphXVF+NILF+LoWWKtaOrXQbBEFI9CJx9kqliXGuIjpp7KdcSBGtrH0F7sjamMIQ9/ZZ2It/+wQwMK+4ZtDGyBIHYBbzE5WQkQUH6hyiVY+1FyI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UEVFxX//+1+8bwskWpB6HhGFeVRVVVVRVoeJTLxvQADeVwqSsIicemCeoIknuIicemCeoIknuIicemCeoIknuIicemCeoIknuIicemCeoIknuIicemCeoIknuIicemCeoIknuIicemCeoIknuIicemCeoIknuIicemCeoIknuIicemCeoIknuIicemCeoIknuIicemCeoIknuIicemCeoIknuIicemCeoIknuIicemCeoIknuIiceqIw/w5NFRUV3qtWiUz80uXLUXeX999IIogg9TwiCvPt7e0kEgnh0wI/P5GJ598LQZDKysq//voL79sCiRaknkdEYX5kZGR4eLihoWGGoeHMefNSjlYd7X1wtPcB41Gf8MTX9j9mbZnf3Ozu56ekpLRz166ff/4Z77sBiSFIPacIxDxLf//999GjRw0MDV0plLzzTcKzznLFvbv+MRu0tLWTU1L+7//+D+87AE1QkHqWCMc8S2/evMkvKNDR1V0cElLS1iYo5Ud7H4Qlb9fW1Y2Mivrqq6/wvmqQBASpJyjzLL18+TIlNVVDU9MvOurQnducKa95/ChqT/YMIyO/gIB//OMfeF8pSMIicuoJzTxLz549i4qO1tbRCd26tar3Qf3gQGLpAbOZM93c3bu6uvC+OpAURczUA/Ojevr0aUBQkI6+vrqGxlxb28uXLzOZTLwvCjQVIlrqp4L54eHhs2fP+gYE6E2fjvrwg+AyNDaOWL++t7d3CnIh+4JqES5Tc/OYuLjBwcEJR1jqzD9//nw+meywYEFi6YHSmzcYj/rqBvrBbDP6Hha2XInM2m02c2Z0TMyff/4p7YzIsqBahLv64af5zc20nelGZmZbtm2b2L+ZKV3mnz9/bmphEbMvr35oEMujESKb0fdw6ZrVSyiUv//+W6pJkVlBtWB31YOehf7+1JCQd+/eiRtnKTI/PDw8n0yO2ZeHe4DkxfWDA56BgbsyM6WXFJkVVIu4rhvod/HyKiouFjfUUmT+7NmzDgsWQJstlivu3tHV1//uu++klxfZFFTLBFzS1qajp/f69WuxQi1F5n0DAhJLD+AeF7kzJSzs4MGD0suLbAqqZWJ2W+bT2NgoVqilyLze9OmlN2/gHhS5c+z+faGrV0svL7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6Dt/vKr1xfX/zxaxTp3YwqhNLS6P27glLTg6IjfUODSVTKPOcnY3MzFRUVVVUVMwszMnu7qvWrE5LS6usrGxpaXny5Alx1uGmXsPDw8+fP+/s7GxoaMjKyqKtW7fAw8PU3FxZWXmampqZlZWdq+tCX18fGo2amBiekRFfVJhcWZn54fF9F84fuN52+H5XzeNHki2bmsePDnfdK2lryzvflPnh8e1HjmwsLAjP2EVNTFwWTnNfscKeTDa1tJympqasrGxuabnAwyM8IiI7O7uxsfHOnTvffPPN+/fvpRErGWJekIaHh1+8ePH06dPOzs4zZ85UVVXl5uZu2749PCJihb//Ag8PG9t5pubm2jo6SkpKCIIoKytr6+rOMDYytbScaWMzx8HBdv58Bzc3J4+FLosWkZYsIVMoZArFzcfHzceH9d+kJUtcFi1y8ljo4OZmO3/+HAeHmTY2ppaWM4yNtHV1lZWVEQRRUlLS1tExNTe3sZ23wMNjhb9/eETE1m3bcnNzKysrz5w509nZ+fTp0xcvXhBz1U029e7du++//35wcLCtre3EiROlpaW7MjJi4uICg4M9Fy+2dXAwNTfX1tVlVY6KqqqOnp6BiYnZzJmzbG1tHB3tXV2d3N1dFnnOX7zY1dubVTbkpUvdli4lUyikxYtdPD2d3N3tXEk2To6z5s0zs7IyMDbW1tVVUVVl1Yyunp6ZhYWdo+OiJUuoISExcXEZGRllZWUnT568fv360NDQDz/8MMXvXMgB89j1/v37P//889WrV8+fP//iiy+ePHnS19fX3d19+/btGzdutLa2Xr58+cKFC01NTefOnTt79uzZs2fPnTvX1NR04cKFy5cvt7a23rhx4/bt293d3X19fU+ePPniiy+eP3/+6tWrP//8U0qNLkgW9P79+z/++OPly5fPnj37/PPPh4aGent7792719HRce3atStXrjQ3N7PK5syZM+yyaW5ubmlpuXbtWkdHx71793p7e4eGhv75z38+e/bs5cuXf/zxh2zWjEIxDwKBRAqYB4GIJWAeBCKWgHkQiFgC5kEgYgmYB4GIpf8HNiyOSuTZCRMAAAAASUVORK5CYII=" alt="" />
1.2、JDBC介绍
SUN公司为了简化、统一对数据库的操作,定义了一套Java操作数据库的规范(接口),称之为JDBC。这套接口由数据库厂商去实现,这样,开发人员只需要学习jdbc接口,并通过jdbc加载具体的驱动,就可以操作数据库。
如下图所示:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAATsAAAFPCAIAAAC9Df5HAAAgAElEQVR4nO2deVgT1/7/B1AWIew7CIoKshhABEEiKjuKCEEUZFFxR0QggArKplgVZN/kWrVVQVERkaq4gICKLL32+T69tc+9Va/31l/Va2ur1taK4fdHIGSZJJMFJpN83s/rjxaSycw5n9ecM2cmiAxBIBDiBMF7ByAQiBABYyEQIgWMhUCIFDAWAiFShDb27du3dXV1foGBhsbGioqKCAQix1FWUbGbNSs1Le3hw4dj4Sd3hDCWTqcfPXrUwMhojo/Pmvz83Kamkq7Oqr5eAJBPKnvvF966mVJ3JGB1nJaubuzq1b/88svYucoIVmM/fPgQt2bNNAf7rIb6mq8HAABgpaS7yycqymLq1H/+85/4G0un0+PWrHHxXlR+7y7uTQMAUktcTraJmdmzZ89wNvbo0aPTHOxBVwAQSGhCwvwFC+h0Om7Gvn371sDICCbDAICFqr5eS2vrCxcu4GZsXV3dHB8f3BsCAIjC2r357p6euBnrFxi4Jj8f91YAAKJQ2t01UVn51atX+BhraGyc29SEeysAAIGYYmNz48YNfIxVVFQs6erEvQkAgEA4enqePHkSH2MRBKnq68W9CQCAQDh7eR0/fhyMBQBiAMYCAJEAYwGASICxAEAkwFgAIBJgLAAQCTBWKimnIghiRbuI/57gQBkFQRCEHNGM+55II2CsdHIxgsz4UwTURKHe2EyzQhCETMsT5l2JVCE+K49GHvkzCeSIZsZ7eb6R8WJKubCHz5BW+MOXA8BYaaWcOuKFMPoxjBU1fEZ1FlFZQi0bsV1AhJZ25PC5dymPRhb2lCRLgLFSy8gwSy3D9vOBmq9HjUUvdHT/eW8Q1X/2LfDe7ABzqEQ9ESRSEb5TX8Zecb5g9MQhr9KCsbgxPDoJV3nM2bIAxyRjLIYtiG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fx+c2+zgZiz2fPn36/fffX758+eTJk4cPHz548ODevXu3b9++fv16a2trc3Pz+fPnz5w5U19ff/r06VOnTp06der06dP19fVnzpw5f/58c3Nza2vr9evXb9++fe/evQcPHjx8+PDJkycvX778/fffP336hPfxQcYwnz59evfu3YsXLx49evSPf/xjYGCgu7v71q1bV69evXTpUlNTU2NjI7NyTp48yaicxsbGCxcuXLp06erVq7du3eru7h4YGPj2228fPXr0/Pnzd+/eSVXZSJ2xEAiET5ANRUUAABCF/w/Q+KxcXWAFmQAAAABJRU5ErkJggg==" alt="" />
JDBC全称为:Java Data Base Connectivity(java数据库连接),它主要由接口组成。
组成JDBC的2个包:
java.sql
javax.sql
开发JDBC应用需要以上2个包的支持外,还需要导入相应JDBC的数据库实现(即数据库驱动)。
二、编写JDBC程序
2.1、搭建实验环境
1、在mysql中创建一个库,并创建user表和插入表的数据。
SQL脚本如下:
1 create database jdbcStudy character set utf8 collate utf8_general_ci;
2
3 use jdbcStudy;
4
5 create table users(
6 id int primary key,
7 name varchar(40),
8 password varchar(40),
9 email varchar(60),
10 birthday date
11 );
12
13 insert into users(id,name,password,email,birthday) values(1,'zhansan','123456','zs@sina.com','1980-12-04');
14 insert into users(id,name,password,email,birthday) values(2,'lisi','123456','lisi@sina.com','1981-12-04');
15 insert into users(id,name,password,email,birthday) values(3,'wangwu','123456','wangwu@sina.com','1979-12-04');
2、新建一个Java工程,并导入数据驱动。
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAARcAAAC3CAIAAAC32o3ZAAAcz0lEQVR4nO2df2wU55nHtz+4/Os/UBv+qERToEhIdYRySN0/4lN/xNBI17vmriLRReZEmCZS1F5cnerogmxDiRxClSnFiasUG+6ayHB1z0DZs1O4NU1soRaFTVI4lxVZJ9Cza69/YIhZU9L3/pjdmffH87wzszO7O+N9Pnpl7c68877vjN/vPM/77rzPJBhBEAEoFAqJWreBIOINqYgggkIqIoighK+iXC7d3tfX1Jdu7+vL5dLhFk4QESRkFeVy6aZ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xLJcQX0oyIKe0CEQlzjLvDgLw2HVnjqC6SwB4R/4ht3wUbpm0BX1r3bncIeEAGJcdyFIrJA7O9YkAZtgRT2gPBP/OIuSA6RamVKW/AgDViBFPaAKAuKu0AQQaG4CwQRlAg9u0AQMYVURBBBIRURRFBIRQQRFFIRQQSFVEQQQSEVEURQSEUEEZQ6URE9okZUkNqo6M0Xt9jJ+1HSI3PSA6ba6Aaa5X3yQgWC8EtoKhodHb1165aXnANPr9N81QG81sv5rlt2oFWRW2wGL5Ctq2tCU9Hrr7/e39+fz+f12d7ct6Uw1VOY6lkYN6cyXRMjbeOD//Lmvi18Qg8WzE3KSBiGwT8srTElnlSExGbwAqmorglTRdPT06+++ur169c12c7s21xYOK9JZ/Ztxo/mOmvKSBgpZF2cGttAH0TB+cwJkV/8J69fErdzW8gnrEvCVBFjLJ/Pm6Z55coVLNuZ9s2FqUFN6m1Zq6mFXzZaXENkv7DYkZcS28AliIKqgJQhOYucYKDtZIvqmpBVxBibnJzs7Oycm5sDs/2qfXNh4oidBlobNQk4vigbWz3FD0L8EiC2gfvyb2kZqmhVStmw7aSi+iZkFc3Ozupt0UDrpsK4aaWB1sbCRA+YpjJdsIpsT67Um4Hv7ivDwd7P6QhQixqpi9tOKqpvwlTRzMyM67jotafXFca7CuNdA62N1gc14RJirDSrILhV8ncltoG3IArcwEjx3Fy2k4rqmmrP0fW2fK6QaRtobSxkOsCklxBjRZ+N67LydzTMoscgCo498ji7wNVJswt1SbV/L3rpW2sGWhsLmTYwuUuIIKJHDZ5d6DW+qElVbgxBBKdOnqMjiApCKiKIoJCKCCIopCKCCAqpiCCCUigU/h+0rAPTVwg+0gAAAABJRU5ErkJggg==" alt="" />
3、编写程序从user表中读取数据,并打印在命令行窗口中。
具体代码如下:
1 package me.gacl.demo;
2 import java.sql.Connection;
3 import java.sql.DriverManager;
4 import java.sql.ResultSet;
5 import java.sql.Statement;
6
7 public class JdbcFirstDemo {
8
9 public static void main(String[] args) throws Exception {
10 //要连接的数据库URL
11 String url = "jdbc:mysql://localhost:3306/jdbcStudy";
12 //连接的数据库时使用的用户名
13 String username = "root";
14 //连接的数据库时使用的密码
15 String password = "XDP";
16
17 //1.加载驱动
18 //DriverManager.registerDriver(new com.mysql.jdbc.Driver());不推荐使用这种方式来加载驱动
19 Class.forName("com.mysql.jdbc.Driver");//推荐使用这种方式来加载驱动
20 //2.获取与数据库的链接
21 Connection conn = DriverManager.getConnection(url, username, password);
22
23 //3.获取用于向数据库发送sql语句的statement
24 Statement st = conn.createStatement();
25
26 String sql = "select id,name,password,email,birthday from users";
27 //4.向数据库发sql,并获取代表结果集的resultset
28 ResultSet rs = st.executeQuery(sql);
29
30 //5.取出结果集的数据
31 while(rs.next()){
32 System.out.println("id=" + rs.getObject("id"));
33 System.out.println("name=" + rs.getObject("name"));
34 System.out.println("password=" + rs.getObject("password"));
35 System.out.println("email=" + rs.getObject("email"));
36 System.out.println("birthday=" + rs.getObject("birthday"));
37 }
38
39 //6.关闭链接,释放资源
40 rs.close();
41 st.close();
42 conn.close();
43 }
44 }
运行结果如下:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQEAAAF/CAIAAADGpusbAAAgAElEQVR4nO2d+5McV3XH+9+x9FN+USnziyqVKqfgB1dEJUixCV7bYmyBgQITQYCKXypWXgQM4NgCU/YSwJYRstfYTCiLUHIsCMEuSS5pHVVtVYJju/yIZa8RXs2+pvNDv+7jnHPv7e6dnZn7/dSWPerue/t29/n2Pbf7ntPJ/Pz89555CX/4i/YvmQcgbpJlAOIGGgCxAw2A2DE1sLi4uN3uGQggwuvV+iEntvWPVoRjwSQeeHm90phQldDWmUzUE9pWpZPFJB54dr222yC3kxbFkCxDAJNGdr2GYDgcDofNlZAYApg/NjPf2z9/bGb+2G3z8186Pn/k+PFjxxeOH1/45fFfnl44fX7h9KU2ruNY4BTANx9aOPHcxRPPXfzmQwsjaZEbCICkiQwsDfT2n18epGn65mCg/qVpeurMYvZ74fQfWrqg24ysgXu+/dMn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dA0MwXRwNGpwFh5iY7wZmbha5U4jE5ul6rpOkMbozJFPJGE/9Ed/R5pydOA/m7rD75epiYZy0dgjAdr8bhc62iQicCayYn2FlbQQP1mCwNVPP5KVOymyy2Sjv0wLIBrbIImeHkjL9RF26xqYwIQQP6lMdUX8/dBLQgQa0zZaNgijrs/dKz1xW0DZjun7aS8KtH1EPI2RVXqk9a9i8b0KqaGylttCRAWUC3v+W3yxEhfZNPtU3fGABtlnxKXWq5HyA0odWsTwDWshto/1Cvm30Adaa9cf0AMfOevuUSE5i9ywa1it6z/xx0PZaz2zMumHIcU64Bd/yGoAGpsEMDRtiVNsvfGnH6eR3U7DQ7ioTrntgjI2oWZt3bh+1fVsBDAyGz/NSuqJzZal0HzwCjSSH4O/WOpe7+3H88oC4I9Z71tfo+60VucNamP0PpB4Q8+pat0ypjA9/DLU+NOrVbOZdUME4cGqCNZuQasCOp+Kgr45aq7rRm8JKf/0RXzh6zWNZnwqrcKq5vYWvOmtDTYhuqxlsHF5EGxqQfEDRgmQLvOpnBK418Ib+D8/PH/YRCFWJaRQ1nXRCvfcrLwD/VmGwl+GiAUftINUDfI3Wf3ixLROBmj/NqPVL10YDfECmgbP1W1RFAUY6WALPxJFt/hlsD8luScA3IjjWrPdOb6XS7Zly8I1eC+cgqEJcpcy/OfTqB2i/dmVY1CXbTa5StfGo1YPZ5XNqNhNrIz9kmH+U7+x/91aTh0xiv94VcCXUeibJdv7pbqmIPX6WOLuVW0ZcoYCe+LZteDUwr7QTDg2kjIg3UGnOC6ScaDYTMmQFRMf0aMKdgAKAz/RoAQAYaALEDDYDYgQZA7Pw/pe9H154HymMAAAAASUVORK5CYII=" alt="" />
2.2、DriverManager类讲解
Jdbc程序中的DriverManager用于加载驱动,并创建与数据库的链接,这个API的常用方法:
- DriverManager.registerDriver(new Driver())
- DriverManager.getConnection(url, user, password),
注意:在实际开发中并不推荐采用registerDriver方法注册驱动。原因有二:
1、查看Driver的源代码可以看到,如果采用此种方式,会导致驱动程序注册两次,也就是在内存中会有两个Driver对象。
2、程序依赖mysql的api,脱离mysql的jar包,程序将无法编译,将来程序切换底层数据库将会非常麻烦。
推荐方式:Class.forName("com.mysql.jdbc.Driver");
采用此种方式不会导致驱动对象在内存中重复出现,并且采用此种方式,程序仅仅只需要一个字符串,不需要依赖具体的驱动,使程序的灵活性更高。
2.3、数据库URL讲解
URL用于标识数据库的位置,通过URL地址告诉JDBC程序连接哪个数据库,URL的写法为:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAhkAAAByCAIAAABx1FRsAAASVUlEQVR4nO2dTY7ruBHHdRYfQAcwfAoBfQWtvPMJ+gbu3vR+LtBeBD7FGwQZZBXvM5kBkkUQBJiXGXQW+uJHFVkURYm0/j8Qgzd+lERWFfkni7Jf9QUAAADEUW3dAAAAAMUDLQEAABALtAQAAEAs0BIAAACxQEsAAADEAi0BAAAQC7QEAABALNASAAAAsUBLAAAAxAItyZPH9ViZHK8Ps9q9tWpR1QAogXs7L3gf12PV3olPw2439/HLsokR7q11abD5oCV5QgeGn3sLLQFF0q+LxOH7uLZD1cf1OFw4zYD9ckw8ivr62w6fjYzQPVav1V0aMAkFa4noCXrTghtVPl2XI8JyPS15XI+Gc8ZPonsxE+O56zZDtCzUt430BZI6dj3G6fJK498lWmXPsI/feffWrGN/Ql/V3r/U0XJvq2PbXu/q38p4XI+cIx9rRd5WRiBr2QZ5XK+uW0FLklCOljikZH9aInoSlX4041tS5+vrS5akpG9GpjOGjxOZLMY+3GV2AJp34sfBMN0No+VxPY6Vw0YQ12iHuZdkWyN0UuI1gc8QaXJc0JJStMQlJdAStopmMysvIalDf0pUG9TGWWl8av/I7bSE6Ps0URsRLZy9HJNHn+LpRsvwPw89zTNxv7O34fYkauYoDdsbgZkzmCmI36VBS5JQipbYI0X9BFoirKF/KqkzfUJmqY2xY96MeoLmys20hKvB2aRVPuHyMVRMU/u5ieP1zs3Q1OzIj7V7m37m2toI3JQRPAUtk+NStbW981pi1rPQraNX6f7OXP2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As0BIAAACxQEsAAADE8n/0TD/0Jgby6gAAAABJRU5ErkJggg==" alt="" />
常用数据库URL地址的写法:
- Oracle写法:jdbc:oracle:thin:@localhost:1521:sid
- SqlServer写法:jdbc:microsoft:sqlserver://localhost:1433; DatabaseName=sid
- MySql写法:jdbc:mysql://localhost:3306/sid
如果连接的是本地的Mysql数据库,并且连接使用的端口是3306,那么的url地址可以简写为: jdbc:mysql:///数据库
2.4、Connection类讲解
Jdbc程序中的Connection,它用于代表数据库的链接,Collection是数据库编程中最重要的一个对象,客户端与数据库所有交互都是通过connection对象完成的,这个对象的常用方法:
- createStatement():创建向数据库发送sql的statement对象。
- prepareStatement(sql) :创建向数据库发送预编译sql的PrepareSatement对象。
- prepareCall(sql):创建执行存储过程的callableStatement对象。
- setAutoCommit(boolean autoCommit):设置事务是否自动提交。
- commit() :在链接上提交事务。
- rollback() :在此链接上回滚事务。
2.5、Statement类讲解
Jdbc程序中的Statement对象用于向数据库发送SQL语句, Statement对象常用方法:
- executeQuery(String sql) :用于向数据发送查询语句。
- executeUpdate(String sql):用于向数据库发送insert、update或delete语句
- execute(String sql):用于向数据库发送任意sql语句
- addBatch(String sql) :把多条sql语句放到一个批处理中。
- executeBatch():向数据库发送一批sql语句执行。
2.6、ResultSet类讲解
Jdbc程序中的ResultSet用于代表Sql语句的执行结果。Resultset封装执行结果时,采用的类似于表格的方式。ResultSet 对象维护了一个指向表格数据行的游标,初始的时候,游标在第一行之前,调用ResultSet.next() 方法,可以使游标指向具体的数据行,进行调用方法获取该行的数据。
ResultSet既然用于封装执行结果的,所以该对象提供的都是用于获取数据的get方法:
获取任意类型的数据
getObject(int index)
getObject(string columnName)
获取指定类型的数据,例如:
getString(int index)
getString(String columnName)
ResultSet还提供了对结果集进行滚动的方法:
- next():移动到下一行
- Previous():移动到前一行
- absolute(int row):移动到指定行
- beforeFirst():移动resultSet的最前面。
- afterLast() :移动到resultSet的最后面。
2.7、释放资源
Jdbc程序运行完后,切记要释放程序在运行过程中,创建的那些与数据库进行交互的对象,这些对象通常是ResultSet, Statement和Connection对象,特别是Connection对象,它是非常稀有的资源,用完后必须马上释放,如果Connection不能及时、正确的关闭,极易导致系统宕机。Connection的使用原则是尽量晚创建,尽量早的释放。
为确保资源释放代码能运行,资源释放代码也一定要放在finally语句中。