网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
【单选题】下列代码生成了一个结果集 conn=DriverManager.getConnection(uri,user,password); stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY); rs=stmt.executeQuery("select * from book"); 下面哪项对该rs描述正确的是
A.只能向下移动的结果集
B.可上下滚动的结果集
C.只能向上移动的结果集
D.不确定是否可以滚动
参考答案和解析
False
更多 “【单选题】下列代码生成了一个结果集 conn=DriverManager.getConnection(uri,user,password); stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY); rs=stmt.executeQuery("select * from book"); 下面哪项对该rs描述正确的是A.只能向下移动的结果集B.可上下滚动的结果集C.只能向上移动的结果集D.不确定是否可以滚动” 相关考题
考题
【问题 3】(6 分)用户登录部分功能调用由位于发布目录 c:\website 下的login.asp 文件实现,数据库连接由 conn.asp 文件实现。其中,数据库文件名为 account.mdb,用户表为 actuser,用户名字段和用户密码字段分别为 act_username 和 act_password。 login.asp 代码如下所示,请将空缺的部分补充完整,并填写在答题纸的相应位置。!--#include file="conn.asp"--%sql="select * from actuser where act_username='"username"'"rs.open sql,conn,1,1if (11) thenresponse.write "scriptalert('登录失败');history.back();/script"response.endelseif rs("act_password")password thenresponse.write "scriptalert('登录失败');history.back();/script"(12)end ifsession("admin")=usernameresponse.write"scriptalert('登录成功');location.href='index.asp'/script"(13)%
考题
下面哪条语句打开的记录集可以前后移动指针,并且可读可写?()
A.rs.Open strSql,connB.rs.Open strSql,conn,1,2C.rs.Open strSql,conn,,2D.rs.Open strSql,conn,1
考题
请根据图6-15网页的显示效果,将ASP程序中(2)、(5)、(7)、(8)、(9)空缺处的代码补充完整。供选择的答案:A.Trim(request("item")) B.rs item.movenextC.rs.movenext D.<!--include file="conn.asp"-->E.select*from data where item="item_type"F.<td width="43"height="30"align="center"><%=rs("Brand")%></td>G.<td width="43"height="30"align="center"><%=rs("hits")%></td>
考题
在模型层中,下列()负责连接数据库
A.Class.forName("oracle.jdbc.OracleDriver");B.conn=DriverManager.getConnection(url,username,userpwd);C.stmt=conn.prepareStatement(sql);D.privateStringurl="jdbc:oracle:thin:@localhost:1521:orcl";
考题
在模型层中,下列()负责加载驱动类
A.Class.forName("oracle.jdbc.OracleDriver");B.conn=DriverManager.getConnection(url,username,userpwd);C.stmt=conn.prepareStatement(sql);D.privateStringurl="jdbc:oracle:thin:@localhost:1521:orcl";
考题
以下是该网站进行数据库连接的代码conn.asp,请完成该程序。 <% set conn=server, createobject ("adodb. connection") conn .provider="sqloledb'' provstr="server=(8);database=(9);uid=sa;pwd=9857452" conn. open provstr %> 2.下面是用户登录检查的,部分程序,要求实现对用户提交的用户名和密码进行检验,如果用户名、密码错误,提示错误并返回首页;如果用户名和密码正确,将用户提交的用户名(user)的值赋给session("user"),然后返回首页。请根据题目说明和功能说明在备选项中选择正确的答案填在答题纸上。 <!--include file="conn.asp"--> <% username=request("user") password=request("password") set rs=server.createobject("adodb.recordset") sql="select * from (10) where username='"username"'" rs.open sql,conn, 1,1 if (11) then response.write"<script. language=Javascript>alert('此用户名尚未注册'); this.location.href='index.asp';</script>" response.end else pass=rs("password") if(12)then response.write"<script language=javascript>alert('密码错误' ; this. location.href='javascript.:history.go(-1)';</script>" response.end end if (13)(14).redirect"index.asp" end if rs.close set rs=(15)%>备选答案A. userB. pass <>passwordC. nosingD. session("user")=usernameE. responseF. pass=passwordG. rs.eofH. requestI. nullJ. shangwuK. rs.end
考题
假设连接的数据记录集当前指向的记录如下:写出以下ASP代码经过IIS服务器解释后的结果。<a href="<%=rs("url")%>" target="_blank"><%=rs("name")%></a>
考题
这段代码有什么不足之处?try {Connection conn = ...;Statement stmt = ...;ResultSet rs = stmt.executeQuery("select * from table1");while(rs.next()) {}} catch(Exception ex) {}
考题
search.asp文件的功能是根据类别、品牌、型号,按照用户输入的关键字进行查询,请为其(4)~(8)处选择合适的答案。【search.asp文件内容】 <htm1> <body> … (数据库连接代码) <% dim sq1,kind,keyword kind=request("kind") keyword=request("keyword") sq1="*select*from 商品明细 where " kind " (4) '%"&keyword&"%'" set rs=server. (5) ("adodb. recoldset") (6) .open sq1,conn,3,2 %> <table border="1"> … (输出表头) % (7) not rs. eof response. write"<tr><td>” rs(“类别”)“</td>” response. write"<td>” rs(“品牌”)“</td>” response. write"<td>" rs(“型号”)"</td>" response. write"<td>" rs(“价格”) "</td></tr>" rs. (8) loop rs.close set rs=nothing > </table> </body> </htm1>A.while B.like C.movenext D.getrecordset E.rsF.sq1G.topH.createobjectI.do while
考题
假设连接的数据记录集当前指向的记录见表4-9。写出以下ASP代码经过IIS服务器解释后的结果。<a href="<%=rs("url")%>" target="_blank"><%=rs("name")%></a>
考题
【问题2】(7分)该商务网站的计数器部分代码如下,请根据题目说明,将空缺的代码补充完整。%set conn= server.createobject("adodb.connection")(7) .provider="sqloledb"provstr="serveF127.0.0.1;database= (8) L;uid=sa;pwd=9857452"conn_.open provstrset rs=conn.Execute("select*from counter")……conn.Execute"Update counter set counteFcounter+l,today=o,statdtm=date(),daynum=daynum+l, yesterday=" rs("today")"”conn.Execute" (9) into yesday(yesday,stats) values(…yesday”’,”rs(”today”)”)”……application. ( 10)if rs("top”)rs("today") thenconn.Execute"Update counter set counter=counter+1,today=today+1, [top]="rs("today")""elseconn.Execute"Update counter set counter=counter+1,today=today+1"end if(11) .unlockend ifcounters= (12)today= (13)yesterday= rs("yesterday")rs.closesetrs= nothingconn.closesetconn=nothing%document.write('font style="FONT-SIZE: 12px;COLOR: #000000;"总共访问量:%=counters%,今日访问:%=today%,昨日访问:%=yesterday%/font');
考题
试题五(共15分)阅读下列说明,根据网页显示的效果图,回答问题1至问题2。【说明 】某电子商务网站如图5-1所示。【index.html 文档的内容 文档的内容 文档的内容 文档的内容】htmlheadtitle网上商城/title/headframeset (1)="15%,70%,15%" noresize="noresize" border=1frame. src="frame_top.html" name="top"frameset (2)="20%,80%"frame. src="frame_left.html" name="left"frame. src="frame_right.html" name="right"/framesetframe. src="count.asp" name="bottom"/frameset/html【frame_left.html 文档的内容】html省略部分代码……centertable border="1" bordercolor="blue"trtda href="content_1.html" (3)="right"img src="img/1.gif" width="100" height="30" border="0"/a/td/tr省略部分代码……/table/center省略部分代码……/html【count.asp 文档的内容 文档的内容 文档的内容 文档的内容】htmlheadtitle计数器/titlebody%Set conn=Server.CreateObject("ADODB.Connection")Set rs=Server.CreateObject("ADODB.(4)")conn.ConnectionString="(5)={Microsoft Access Driver (*.mdb)};Uid=;Pwd=;DBQ="Server. (6) ("database/count.mdb")conn.open()(7) sqlsql="(8) count set hit=hit+1"conn.(9)(sql)%sql = "select * from count"set rs=conn.execute(sql)%%lasthit=rs.fields("lasthit")tdate=year(Now()) "-" month(Now()) "-" day(Now())sql="update count set lasthit='" tdate"' where ID="rs.fields("id")conn.execute(sql)%%sql = "select * from count"set rs=conn.execute(sql)%table bgcolor=bluetrtd width="100%" align=center总访问%=rs("hit")%次,最后访问日期%=rs("lasthit")%/td/tr/table%rs.close()%/body/html【问题1】(6 分)为程序中(1)~(3)处空缺选择正确答案,并填入答题纸对应的解答栏内。(1)~(3)备选答案:A. srcB. colsC. rowsD. targetE. link
考题
请根据图2-13网页的显示效果,将ASP程序中(2)、(5)、(7)、(8)、(9)空缺处的代码补充完整。A.Trim (request("item")) B.rs_item.movenextC. rs.movenext D. <!--include file="conn.asp" -->E. select * from data where item="item_type"F. <td width="43"height="30"align="center"><%=rs ("Brand") %></td>G. <td width="43"height="30"align="center"><%=rs ("hits") %></td>
考题
某留言系统采用ASP+Access开发,其后台管理登录页面如图4-1所示。图4-1【问题1】(9分)以下是该后台管理登录页面login.asp的部分代码,请仔细阅读该段代码,根据图4-1 将(1)~(9)的空缺代码补齐。!--include file=“conn.asp”--!--include file=“md5.asp”--!--include file=“bbb.asp”--%If request.Form(“submit”)=“管理登录”Thenuser_name = request.Form(“ (1) ”)password = request.Form(“ (2) ”)verifycode = request.Form(“ (3) ”)If user name =“” ThenCallinfoback(“用户名不能为空!”)End If......Set (4) = server. CreateObject(“adodb.recordset”)sql = “select * from administrator (5) user_name = “user_name”andpassword = “md5(password)””rs.Open (6) ,conn,1,1If (7) rs.EOF Thensession(“user_name”)= user_nameresponse.redirect“information.asp”ElseCall infoback(“用户名或密码错误!”)End IfEnd If%html ......bodyform. method=“post”action=“login.asp”id=“login”hl管理员登录/hllabel for=“user_name”用户名:input name=“user_name” type=“text” class=“user_name” id=“uname” size=“25”//labellabel for=“password“密码:input name=“password”type=“password”id=“pword” size=“25”//labellabel for=“verifycode”验证码:input name=“verifycode” type=“text” class=“verifycode” id=“vcode” size=“10”maxlength=“4”/img src=“code.asp” nclick=“javascript.:this.src=‘code.asp?tm=’+Math.random()”style=“cursos:pointer” alt=“点击更换” title=“点击更换”//labelp class=“center”input name=“reset”type=“ (8) ” class=“submit” value=“清除数据”/input type=“ (9) ” name=“submit” class=“submit”value=“管理登录”//p/form/body/html(1)~(9)备选答案如下:A.pword B.where C.uname D.vcode E.resetF.submit G.rs H.sql I. Not
考题
以下用法中正确的是()ARS = conn.Execute(“SELECT *FORM product”)BSet RS = conn.Execute (“SELECT *FORM product”)CConn.Execute (“DELETE *FORM product WHERE ID=132”)DConn.Ececute “DELETE *FORM product WHERE ID=132”
考题
下面()语句打开的记录集可以前后移动指针,并且可读可写。A、rs.Open strSql,connB、rs.Open strSql,conn,1,2C、rs.Open strSql,conn,,2D、rs.Open strSql,conn,1
考题
面是创建Statement接口并执行executeUpdate方法的代码片段: conn=DriverManager.getConnection("jdbc:odbc:book","",""); stmt=conn.createStatement(); String strsql="insert into book values(’TP003’, ’ASP.NET’,’李’,’清华出版社’,35)"; n=stmt.executeUpdate(strsql); 代码执行成功后n的值为()。A、 1B、 0C、 -1D、 一个整数
考题
现有书目表book,包含字段:price(float);现在查询一条书价最高的书目的详细信息,以下语句正确的是()A、select top 1 * from book order by price ascB、select top 1 * from book order by price descC、select top 1 * from book where price= (select max (price)from book)D、select top 1 * from book where price= max(price)
考题
现有书目表book,包含字段:价格price(float),类别type(char);现在查询各个类别的平均价格、类别名称,以下语句正确的是()。A、select avg(price),type from book group by typeB、select count(price),type from book group by priceC、select avg(price),type from book group by priceD、select count(price),type from book group by type
考题
如果希望打开的记录集可以前后移动指针,并且可读可写,则应该为下面哪一句()A、rs.opensql,connB、rs.opensql,conn,1,3C、rs.opensql,conn,3,3D、rs.opensql,conn,1
考题
如果要查询book表中所有书名以“数据库”开头的书籍价格,下列()语句是正确的。A、SELECT price FROM book WHERE book_name=“数据库*”B、SELECT price FROM book WHERE book_name LIKE“数据库*”C、SELECT price FROM book WHERE book_name=“数据库%”D、SELECT price FROM book WHERE book_name LIKE“数据库%”
考题
. Your network consists of a single Active Directory domain. All servers run Windows Server 2003 Service Pack 2 (SP2). You create a new domain user account named User1 and assign the account a password of P@ssw0rd. On the new account, you enable the User must change password at next logon option. A week later, you discover that User1 is still using the password P@ssw0rd to log on to the domain. You need to ensure that User1 is forced to use a different password the next time she changes her password. What should you do first? ()A、In the Default Domain Policy, select Enforce password history.B、In the Default Domain Policy, select Passwords must meet complexity requirements.C、From the User’s account properties, select Account is sensitive and cannot be delegated.D、From the User’s account properties, select Store password using reversible encryption.
考题
Your network consists of a single Active Directory domain. All servers run Windows Server 2003 Service Pack 2 (SP2). You create a new domain user account named User1 and assign the account a password of P@ssw0rd. On the new account, you enable the User must change password at next logon option. A week later, you discover that User1 is still using the password P@ssw0rd to log on to the domain. You need to ensure that User1 is forced to use a different password the next time she changes her password. What should you do first? ()A、In the Default Domain Policy, select Enforce password history.B、In the Default Domain Policy, select Passwords must meet complexity requirements.C、From the User’s account properties, select Account is sensitive and cannot be delegated.D、From the User’s account properties, select Store password using reversible encryption.
考题
单选题利用Recordset对象可以得到查询结果集。下列将SC表中的全部数据放置到Recordset对象中的语句,正确的是()。A
ADOrs.Open Select * From SCB
ADOrs.Execute Select * From SCC
ADOrs.Create Select * From SCD
ADOrs.Select * From SC
考题
单选题面是创建Statement接口并执行executeUpdate方法的代码片段: conn=DriverManager.getConnection("jdbc:odbc:book","",""); stmt=conn.createStatement(); String strsql="insert into book values(’TP003’, ’ASP.NET’,’李’,’清华出版社’,35)"; n=stmt.executeUpdate(strsql); 代码执行成功后n的值为()。A
1B
0C
-1D
一个整数
考题
单选题以下用法中正确的是()A
RS = conn.Execute(“SELECT *FORM product”)B
Set RS = conn.Execute (“SELECT *FORM product”)C
Conn.Execute (“DELETE *FORM product WHERE ID=132”)D
Conn.Ececute “DELETE *FORM product WHERE ID=132”
考题
单选题要获得记录集RS中,当前记录的“产品型号”字段的值,该字段的顺序号为1,以下用法中,不正确的是()A
fdvalue=RS(1)B
fdvalue=RS.Fields(“产品型号”)C
fdvalue=RS.(“产品型号”)D
fdvalue=RS.Fields(产品型号).Value
热门标签
最新试卷