JSP 预处理语句的优点
jsp的功能

jsp的功能JSP(JavaServer Pages)是一种用来开发动态Web页面的Java技术。
它可以将Java代码嵌入到HTML文档中,以实现更丰富的页面交互和动态数据展示功能。
以下是JSP的一些常见功能。
1. 动态页面生成:JSP可以根据用户请求,动态生成HTML页面,并将页面内容返回给浏览器。
这使得网页内容可以根据不同的条件和参数进行自适应的展示。
开发者可以在JSP中使用Java代码来处理用户请求,调用数据库、调用其他Java对象等。
2. 数据库访问:JSP可以直接连接数据库,并执行数据库操作。
通过使用Java的数据库连接API,JSP可以从数据库中查询、添加、修改和删除数据,然后将结果展示在Web页面上。
这可以实现数据的持久化和动态更新。
3. 表单处理:JSP可以处理用户提交的表单数据。
通过在JSP页面中定义HTML表单元素,并在表单的提交动作中指定JSP的URL,JSP可以接收表单数据,并对数据进行验证、处理和存储。
这些可以用来实现用户注册、登录、数据录入等功能。
4. 条件判断和循环:JSP支持使用Java的条件语句和循环语句。
这使得可以在JSP页面中根据不同的条件展示不同的内容,或者重复展示一段代码块。
通过使用if语句、switch语句和for循环等,可以实现更复杂的页面逻辑。
5. 页面重定向和转发:JSP可以将请求重定向到其他页面,或者将请求转发到另一个JSP或Servlet。
这使得可以在不同的页面之间进行跳转和协作,实现业务流程的分步处理。
6. 用户认证和会话管理:JSP提供了与用户认证和会话管理相关的内置对象。
通过这些对象,可以实现用户登录、注销、用户角色权限控制等功能。
同时,JSP还支持在页面级别和应用程序级别上进行会话管理。
7. 页面模板和复用:JSP支持使用页面模板和标签库进行页面复用。
可以将多个JSP页面中的公共部分抽取出来,形成一个模板文件,然后在其他JSP页面中引用该模板文件。
JSP技术简介

第1章JSP技术简介JSP(Java Server Pages)技术是由Sun公司发布的用于开发动态Web应用的一项技术。
它以其简单易学、跨平台的特性,在众多动态Web应用程序设计语言中异军突起,在短短几年中已经形成了一套完整的规范,并广泛地应用于电子商务等各个领域中。
在国内,JSP 现在也得到了比较广泛的重视,得到了很好的发展,越来越多的动态网站开始采用JSP技术。
本章就对JSP及其相关技术进行简单的介绍。
1.1 认识HTTP协议HTTP协议(Hypertext Transfer Protocol,超文本传送协议)是WWW服务器使用的主要协议,对HTTP协议细节的基本理解是编写JSP或Java小程序的开发人员所必需的。
因此在学习JSP技术之前有必要更加仔细地研究一下HTTP消息的格式(这里的讨论源自HTTP/1.1协议规范。
参见规范2616,网址为/rfc/rfc2616.txt)。
HTTP 协议的关键部分有HTTP请求和HTTP响应,以及客户端Web程序设计的一些基础知识,在第4章4.4节将会具体介绍。
1.2 客户端Web程序设计介绍Web浏览器现已成为深受大多数用户喜爱的用户界面。
HTML语言提供了丰富的控件,第三方厂商提供了Visual Basic编写的数百个额外的控件,这些都使得Web浏览器独具特色。
虽然Web浏览器与传统的GUI界面有一定的差距,但它提供了一种独立而又简单的方法来访问分布式资源,尤其是Internet资源。
而且越来越多的客户端Web程序扩展技术变得更加成熟,出现了包括CSS、JavaScript、VBScript、动态HTML、Java1.1.Applet应用程序等技术在内的客户端Web程序设计技术,它们的相互结合使得Web程序更加迷人。
下面简单介绍几种常用的客户端Web程序设计技术的特点。
本书假定读者对这些技术都有一定的了解,不对这些技术作详细介绍。
1.2.1 CSSCSS(Cascading Style Sheets)称为层叠样式表,是动态HTML技术的一个部分,但可以和HTML结合使用。
JSP语言的特点与优势

2007年12月10日第12期FINANCIALCOMPUTEROFHUANAN.DEC.10,2007NO.12华南金融电脑JSP全名JavaServerPage,是Sun公司的网站开发语言。
JSP可以在Serverlet和JavaBean的支持下,完成功能强大的站点程序。
一、JSP语言总述JSP提供在HTML代码中混合某种程序代码、由语言引擎解释执行程序代码的能力。
JSP代码被编译成Servlet并由Java虚拟机解释执行,这种编译操作仅在对JSP页面的第一次请求时发生。
在JSP环境下,HTML代码主要负责描述信息的显示样式,而程序代码则用来描述处理逻辑。
普通的HTML页面只依赖于Web服务器,而JSP页面需要附加的语言引擎分析和执行程序代码。
程序代码的执行结果被重新嵌入到HTML代码中,然后一起发送给浏览器。
JSP是面向Web服务器的技术,客户端浏览器不需要任何附加的软件支持。
二、JSP语言的特点(一)、将内容的产生和显示进行分离使用JSP技术,Web页面开发人员可以使用HTML或者XML标识来设计和格式化最终页面。
使用JSP标识或者小脚本来产生页面上的动态内容。
产生内容的逻辑被封装在标识和JavaBeans群组件中,并且捆绑在小脚本中,所有的脚本在服务器端执行。
如果核心逻辑被封装在标识和Beans中,那么其他人,如Web管理人员和页面设计者,能够编辑和使用JSP页面,而不影响内容的产生。
在服务器端,JSP引擎解释JSP标识,产生所请求的内容(例如,通过存取JavaBeans群组件,使用JDBC技术存取数据库),并且将结果以HTML(或者XML)页面的形式发送回浏览器。
这有助于作者保护自己的代码,而又保证任何基于HTML的Web浏览器的完全可用性。
(二)、强调可重用的群组件绝大多数JSP页面依赖于可重用且跨平台的组件(如:JavaBeans或者EnterpriseJavaBeans)来执行应用程序所要求的更为复杂的处理。
JSP动态网页编程

一、选择题(每小题 1.5 分,共 15 分)1、下面不是使用文件字节流读写文件的类的是:()A、FileInputStreamB、InputStreamC、FileOutputStreamD、FileReader2、对于预定义<%!预定义%>的说法错误的是:()A、一次可声明多个变量和方法,只要以“;”结尾就行B、一个声明仅在一个页面中有效C、声明的变量将作为局部变量D、在预定义中声明的变量将在JSP页面初始化时初始化3、从“员工” 表的“姓名”字段中找出名字包含“玛丽”的人下面哪条select语句正确:()A、Select * from员工where 姓名=‟_玛丽_‟B 、Select * from员工where 姓名=‟%玛丽_‟C、Select * from员工where 姓名like …_玛丽%‟D、Select * from员工where 姓名like …%玛丽%‟4、下述选项中不属于JDBC基本功能的是:()A、与数据库建立连接B、提交SQL语句C、处理查询结果D、数据库维护管理5、在JSP中使用<jsp:getProperty>标记时,不会出现的属性是:()A、nameB、propertyC、valueD、以上皆不会出现6、Page指令用于定义JSP文件中的全局属性,下列关于该指令用法的描述不正确的是:()A、<%@ page %>作用于整个JSP页面。
B、可以在一个页面中使用多个<%@ page %>指令。
C、为增强程序的可读性,建议将<%@ page %>指令放在JSP文件的开头,但不是必须的。
D、<%@ page %>指令中的属性只能出现一次。
7、下列表单控件中哪个是文本框?()A、<input type="radio"/>B、<input type="checkbox"/>C、<input type="text"/>D、<input type="single"/>8、关于JavaBean正确的说法是:()A、Java文件与Bean所定义的类名可以不同,但一定要注意区分字母的大小写B、在JSP文件中引用Bean,其实就是用<jsp:useBean>语句C、被引用的Bean文件的文件名后缀为.javaD、Bean文件放在任何目录下都可以被引用9、假设Tomcat5.5中名为helloapp的Web应用有一HelloServlet类,它位于.fjnu包下,它在web.xml文件中的配置如下:<servlet><servlet-name> HelloServlet </servlet-name><servlet-class>.fjnu.HelloServlet</servlet-class></servlet><servlet-mapping><servlet-name> HelloServlet </servlet-name><url-pattern>/hello</url-pattern></servlet-mapping>那么在浏览器端访问HelloServlet的URL是:()A、http://localhost:8080/helloB、http://localhost:8080/helloapp/HelloServletC、http://localhost:8080/helloapp/cn/edu/fjnu/helloD、http://localhost:8080/helloapp/hello10、不能在不同用户之间共享数据的方法是()A、通过session对象B、利用文件系统C、利用数据库D、通过application对象二、填空题(每空 1 分,共 15 分)1、若要更改Tomcat服务器的默认端口,则需要修改文件(1) 。
JSP期末模拟题

JSP期末模拟题1、JSP期末模拟题A卷一填空题(每空2分,共10分)创建JSP 应用程序时,配置文件web.xml应该在程序下的_目录中。
2、如果编写一个计数器程序,用来记载当前网站的访问量,最好采用JSP中的_对象。
Http的中文含义为_。
Tomcat服务器的默认端口为_。
在html标记中,_标记用于设置当前页面的标题。
3、答案:WEB-INFapplication超文本传输协议title二判断正误题(每题1分,共10分)1Internet和intranet的含义意义相同。
()2Web开发技术包括客户端和服务器端的技术。
()3在网页中图形文件与网页文件是分别存储的。
4、()4超级链接不仅可以将文本作为链接对象,也可以将图像作为链接对象。
5、()5超级链接标记的target属性取值为链接的目标窗名,可以是parent、blank、self、top。
6、()6JSP引擎执行字节码文件的主要任务之一是直接将HTML 内容发给客户端。
()7在“”标记之间声明的Java的方法在整个页面内有效。
7、()8程序片变量的有效范围与其声明位置有关,即从声明位置向后有效,可以在声明位置后的程序片、表达式中使用。
()9不可以用一个page指令指定多个属性的取值。
8、()jsp:param动作标记不能单独使用,必须作为jsp:include、jsp:forward标记等的子标记使用,并为它们提供参数。
()答案:错对对对错对对对错对三.简答题(每题5分,共50分)JSP中可重复使用的组件有哪些?什么是JSP的预编译特征?开发JSP程序可采用哪几种开发模式?分别介绍他们的优缺点。
什么是成员变量和局部变量?他们的区别是什么?JSP特点为什么使用JSP?JSP编译和执行过程JSP页面组成部分(4个)以及其作用一个JSP页面包含的内容JSP声明以及形式答案:JavaBean/JSP标准标签/自定义标签JSP页面在被服务器执行前,都是已经被编译好的,并且通常只进行一次编译,即在JSP页面被第一次请求时进行编译,在后续的请求中如果JSP页面没有被修改过,服务器只需要直接调用这些已经被编译好的代码,这大大提高了访问速度。
外文文献—JSP的优势

附录I 英文翻译1、英文部分Benefits of JSPJSP pages are translated into servlets. So, fundamentally, any task JSP pages can perform could also be accomplished by servlets. However, this underlying equivalence does not mean that servlets and JSP pages are equally appropriate in all scenarios. The issue is not the power of the technology, it is the convenience, productivity, and maintainability of one or the other. After all, anything you can do on a particular computer platform in the Java programming language you could also do in assembly language. But it still matters which you choose..JSP provides the following benefits over servlets alone:• It is easier to write and maintain the HTML. Your static code is ordinary HTML: no extra backslashes, no double quotes, and no lurking Java syntax.• You can use standard Web-site development tools. Even HTML tools that know nothing about JSP can be used because they simply ignore the JSP tags• You can divide up your development team. The Java programmers can w ork on the dynamic code. The Web developers can concentrate on the presentation layer. On large projects, this division is very important. Depending on the size of your team and the complexity of your project, you can enforce a weaker or stronger separation between the static HTML and the dynamic content.Now, this discussion is not to say that you should stop using servlets and use only JSP instead. By no means. Almost all projects will use both. For some requests in your project, you will use servlets. For others, you will use JSP. For still others, you will combine them with the MVC architecture . You want the appropriate tool for the job, and servlets, by themselves, do not complete your toolkitAdvantages of JSP Over Competing TechnologiesA number of years ago, Marty was invited to attend a small 20-person industry roundtable discussion on software technology. Sitting in the seat next to Marty was James Gosling, inventor of the Java programming language. Sitting several seats away was a high-level manager from a very large software company in Redmond, Washington. During the discussion, the moderator brought up the subject of Jini, which at that time was a new Java technology. The moderator asked the manager what he thought of it, and the manager responded that it was too early to tell, but that it seemed to be an excellent idea. He went on to say that they would keep an eye on it, and if it seemed to be catching on, they would follow his company's usual "embrace and extend" strategy. At this point, Gosling lightheartedly interjected "You mean disgrace and distend."Now, the grievance that Gosling was airing was that he felt that this company would take technology from other companies and suborn it for their own purposes. But guess what? The shoe is on the other foot here. The Java community did not invent the idea of designing pages as a mixture of static HTML and dynamic code marked with special tags. For example, ColdFusion did it years earlier. Even ASP (a product from the very software company of the aforementioned manager) popularized this approach before JSP came along and decided to jump on thebandwagon. In fact, JSP not only adopted the general idea, it even used many of the same special tags as ASP did.So, the question becomes: why use JSP instead of one of these other technologies? Our first response is that we are not arguing that everyone should. Several of those other technologies are quite good and are reasonable options in some situations. In other situations, however, JSP is clearly better. Here are a few of the reasons.Versus .NET and Active Server Pages (ASP)NET is well-designed technology from Microsoft. is the part that directly competes with servlets and JSP. The advantages of JSP are twofoldFirst, JSP is portable to multiple operating systems and Web servers; you aren't locked into deploying on Windows and IIS. Although the core .NET platform runs on a few non-Windows platforms, the ASP part does not. You cannot expect to deploy serious applications on multiple servers and operating systems. For some applications, this difference does not matter. For others, it matters greatly.Second, for some applications the choice of the underlying language matters greatly. For example, although .NET's C# language is very well designed and is similar to Java, fewer programmers are familiar with either the core C# syntax or the many auxiliary libraries. In addition, many developers still use the original version of ASP. With this version, JSP has a clear advantage for the dynamic code. With JSP, the dynamic part is written in Java, not VBScript or another ASP-specific language, so JSP is more powerful and better suited to complex applications that require reusable componentsYou could make the same argument when comparing JSP to the previous version of ColdFusion; with JSP you can use Java for the "real code" and are not tied to a particular server product. However, the current release of ColdFusion is within the context of a J2EE server, allowing developers to easily mix ColdFusion and servlet/JSP code.Versus PHPPHP (a recursive acronym for "PHP: Hypertext Preprocessor") is a free, open-source, HTML-embedded scripting language that is somewhat similar to both ASP and JSP. One advantage of JSP is that the dynamic part is written in Java, which already has an extensive API for networking, database access, distributed objects, and the like, whereas PHP requires learning an entirely new, less widely used language. A second advantage is that JSP is much more widely supported by tool and server vendors than is PHP.Versus Pure ServletsJSP doesn't provide any capabilities that couldn't, in principle, be accomplished with servlets. In fact, JSP documents are automatically translated into servlets behind the scenes. But it is more convenient to write (and to modify!) regular HTML than to use a zillion println statements to generate the HTML. Plus, by separating the presentation from the content, you can put different people on different tasks: your Web page design experts can build the HTML by using familiar tools and either leave places for your servlet programmers to insert the dynamic content or invoke the dynamic content indirectly by means of XML tags.Does this mean that you can just learn JSP and forget about servlets? Absolutely not! JSP developers need to know servlets for four reasons:1. JSP pages get translated into servlets. You can't understand how JSP works without understanding servlets.2. JSP consists of static HTML, special-purpose JSP tags, and Java code. What kind of Java code? Servlet code! You can't write that code if you don't understand servlet programming3. Some tasks are better accomplished by servlets than by JSP. JSP is good at generating pages that consist of large sections of fairly well structured HTML or other character data. Servlets are better for generating binary data, building pages with highly variable structure, and performing tasks (such as redirection) that involve little or no output.4. Some tasks are better accomplished by a combination of servlets and JSP than by either servlets or JSP alone.Versus JavaScriptJavaScript, which is completely distinct from the Java programming language, is normally used to dynamically generate HTML on the client, building parts of the Web page as the browser loads the document. This is a useful capability and does not normally overlap with the capabilities of JSP (which runs only on the server). JSP pages still include SCRIPT tags for JavaScript, just as normal HTML pages do. In fact, JSP can even be used to dynamically generate the JavaScript that will be sent to the client. So, JavaScript is not a competing technology; it is a complementary one.It is also possible to use JavaScript on the server, most notably on Sun ONE (formerly iPlanet), IIS, and BroadVision servers. However, Java is more powerful, flexible, reliable, and portable.Versus WebMacro or VelocityJSP is by no means perfect. Many people have pointed out features that could be improved. This is a good thing, and one of the advantages of JSP is that the specification is controlled by a community that draws from many different companies. So, the technology can incorporate improvements in successive releasesHowever, some groups have developed alternative Java-based technologies to try to address these deficiencies. This, in our judgment, is a mistake. Using a third-party tool like Apache Struts that augments JSP and servlet technology is a good idea when that tool adds sufficient benefit to compensate for the additional complexity. But using a nonstandard tool that tries to replace JSP is a bad idea. When choosing a technology, you need to weigh many factors: standardization, portability, integration, industry support, and technical features. The arguments for JSP alternatives have focused almost exclusively on the technical features part. But portability, standardization, and integration are also very important. For example, the servlet and JSP specifications define a standard directory structure for Web applications and provide standard files (.war files) for deploying Web applications. All JSP-compatible servers must support these standards. Filters can be set up to apply to any number of servlets or JSP pages, but not to nonstandard resources. The same goes for Web application security settings.Besides, the tremendous industry support for JSP and servlet technology results in improvements that mitigate many of the criticisms of JSP. For example, the JSP Standard Tag Library and the JSP 2.0 expression language address two of the most well-founded criticisms: the lack of good iteration constructs and the difficulty of accessing dynamic results without using either explicit Java code or verbose jsp:useBean elementsForgetting JSP Is Server-Side TechnologyHere are some typical questions Marty has received (most of them repeatedly)• Our server is running JDK 1.4. So, how do I put a Swing component in a JSP page?• How do I put an image into a JSP page? I do not know the proper Java I/O commands to read image files• Since Tomcat does not support JavaScript, how do I make images that are highlighted when the user moves the mouse over them?• Our clients use older browsers that do not understand JSP. What should we do?• When our clients use "View Source" in a browser, how can I prevent them from seeing the JSP tags?All of these questions are based upon the assumption that browsers know something about the server-side process. But they do not. Thus:• For putting applets with Swing components into Web pages, what matters is the browser's Java version—the server's version is irrelevant. If the browser supports the Java 2 platform, you use the normal APPLET (or Java plug-in) tag and would do so even if you were using non-Java technology on the server.• You do not need Java I/O to read image files; you just put the i mage in the directory for Web resources (i.e., two levels up from WEB-INF/classes) and output a normal IMG tag • You create images that change under the mouse by using client-side JavaScript, referenced with the SCRIPT tag; this does not change just because the server is using JSP• Browsers do not "support" JSP at all—they merely see the output of the JSP page. So, make sure your JSP outputs HTML compatible with the browser, just as you would do with static HTML pages.• And, of course you need not do anyt hing to prevent clients from seeing JSP tags; those tags are processed on the server and are not part of the output that is sent to the client.Confusing Translation Time with Request TimeA JSP page is converted into a servlet. The servlet is compiled, loaded into the server's memory, initialized, and executed. But which step happens when? To answer that question, remember two points:• The JSP page is translated into a servlet and compiled only the first time it is accessed after having been modified.• L oading into memory, initialization, and execution follow the normal rules for servlets.2、中文部分:JSP的优势JSP页面最终会转换成servler。
动态网页设计第1章

5. 发布目录
建立Web站点时,需指定包含要发布文档的目录。 Web服务器无法发布未包含在指定目录中的文档。要 计划Web站点,必须首先确定如何组织发布目录中的 文件。发布目录可以是主目录或虚拟目录。
6. 主目录
每个Web站点都必须有一个主目录。“主目录” 是站点访问者的起始点,也是Web发布树的顶端。其 中包含主页或索引文件,用来欢迎访问者并包含指向 Web站点中其他页的链接。主目录映射到站点的域名。 例如,如果站点的Internet域名是: 主目录是C:\Website\Microsoft,则Web浏览器使 用网址: / 来访问C:\Website\Microsoft目录中的文件。
ASP可以使用两种脚本语言:VBScript和Jscript。 所谓的Jscript语言就是微软版本的JavaScript语言。 本书所有案例程序基于VBScript语言。 ASP包含内置对象,最常用的是五大对象、一个集 合和一个文件。五大对象分别是:Response, Request,Session,Application和Server,一个集 合是Cookies,一个文件是Global.asa。 通过ADO数据访问接口可以方便地操作各种数据库。 通过ADO访问数据库有三种标准的访问格式。
JSP 预处理语句应用

JSP 预处理语句应用
现在创建一个案例,演示PreparedStatement接口对象的使用。
打开记事本,输入下列代码:
在源文件中,首先确保连接到MySQL数据库,即创建Connection对象conn。
下面创建字符串变量sql,其值为添加数据的sql语句,其中“?”我们称之为IN参数。
包含于PreparedStatement对象中的SQL语句可具有一个或多个IN参数。
IN参数的值在SQL语句创建时未被指定。
相反的,该语句为每个IN参数保留一个问号(“?”)作为占位符。
每个问号的值必须在该语句执行之前,通过适当的setXXX 方法来提供。
然后使用语句“PreparedStatement ps=conn.prepareStatement(sql);”创建Prepare dStatement实例化对象ps,并以sql作为参数进行预编译。
通过ps对象的setXXX 方法将为IN参数提供值。
如“ps.setString(1,"Ajax入门到精通");”语句。
最后调用PreparedStatement对象的executeUpdate()方法,执行数据的添加操作。
当然了,SQ
将上述代码保存,名称为PreparedExample.jsp。
打开IE浏览器,在地址栏中输入http://localhost:8080/JSPExample/PreparedExample.jsp,单击【转到】,会显示如图6-19所示窗口。
在MySQL客户端窗口,查询添加的数据,如图6-20所示:
图6-19 数据添加成功
图6-20 MySQL数据显示。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
JSP 预处理语句的优点
预处理语句具有两个主要的优点:
●查询只需要被解析(或准备)一次,但可以使用相同或不同的参数执行多
次。
当查询准备好(Prepared)之后,数据库就会分析,编译并优化它要
执行查询的计划。
对于复杂查询来说,如果要重复执行许多次有不同参数
的但结构相同的查询,这个过程会占用大量的时间,使得应用变慢。
通过
使用一个预处理语句就可以避免重复分析、编译、优化的环节。
简单来说,
预处理语句使用更少的资源,执行速度也就更快。
●传给预处理语句的参数不需要使用引号,底层驱动会处理这个。
如果应用
独占地使用预处理语句,就可以确信没有SQL注入会发生。
正因为预处理语句是如此有用,它成了PDO惟一为不支持此特性的数据库提供的模拟实现。
这使你可以使用统一的数据访问规范而不必关心数据库本身是否具备此特性。
在JDBC组件中,PreparedStatement接口创建表示预编译的SQL语句的对象。
SQL语句经过预编译,并存储在PreparedStatement对象中。
然后,此对象可用来有效地多次执行此语句。
PreparedStatement接口继承Statement类,并与之在两方面有所不同:
●PreparedStatement实例包含已编译的SQL语句。
由于PreparedStatement对
象已预编译过,所以其执行速度要快于Statement对象。
因此,多次执行
的SQL语句经常创建为PreparedStatement对象,以提高效率。
●包含于PreparedStatement对象中的SQL语句可具有一个或多个IN参参。
IN参数的值在SQL语句创建时未被指定。
相反的,该语句为每个IN参数
保留一个问号(“?”)作为占位符。
每个问号的值必须在该语句执行之前,
通过适当的SetXXX方法来提供。
作为Statement的子类,PreparedStatement继承了Statement的所有功能。
另外它还添加了一整套方法,用于设置发送给数据库以取代IN参数占位符的值。
同时,三种方法execute、executeQuery和executeUpdate已被更改又以使其不再需要参数。
这些方法的Statement形式(接受SQL语句参数的形式)不应该用于PreparedStatement对象。
其详细信息如表6-6所示:
表6-6 PreparedStatement接口方法
上述表格中,setxxx类型方法还有setLong()、setString()等,其含义和表格中方法相同,这里就不在介绍。