读书人

数据显示有关问题 从数据老是得不到

发布时间: 2012-02-01 16:58:19 作者: rapoo

数据显示问题,急急 从数据老是得不到数据
下面是我写的一个代码,在数据实现的地方
“工作平台 <%=rs.getString( "c_usr_id ")%> ”中老是得不到数据,
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN "
"http://www.w3.org/TR/html4/loose.dtd ">
<html>
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=UTF-8 ">
<title> 长宇科技OA系统 </title>
<%@ page language= "java " contentType= "text/html; charset=UTF-8 " pageEncoding= "UTF-8 "%>
<%@page import= "com.gsi.role.db.ConnDB2Imp " %>
<%@page import= "java.sql.ResultSet " %>
<META http-equiv= "Content-Type " content= "text/html; charset=UTF-8 ">
<META name= "GENERATOR " content= "IBM Software Development Platform ">
<META http-equiv= "Content-Style-Type " content= "text/css ">
<script type= "text/JavaScript ">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i <a.length; i++)
if (a[i].indexOf( "-# ")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i <a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf( "? "))> 0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i <d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i <d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i <(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<SCRIPT language=javascript1.2>
function showsubmenu(sid)
{
whichEl = eval( "submenu " + sid);
if (whichEl.style.display == "none ")
{
eval( "submenu " + sid + ".style.display=\ "\ "; ");
}
else
{
eval( "submenu " + sid + ".style.display=\ "none\ "; ");
}
}
function stop()
{window.close()}
</SCRIPT>
<link href= "css/css.css " rel= "stylesheet " type= "text/css ">
<style type= "text/css ">


<!--
body {
margin-left: 0px;
margin-right: 0px;
}
-->
</style> </head>
<% String UsrID =(String)session.getAttribute( "userName ");
ConnDB2Imp conndb = new ConnDB2Imp();
String sql= "select c_role_id from sys_role_usr where c_usr_id = ' "+UsrID+ " ' and rownum=1; ";
ResultSet rs = conndb.returnSelectRs(sql);
%>
<body>
<table width= "1001 " border= "1 " align= "center " cellpadding= "0 " cellspacing= "0 " bordercolor= "#CCCCCC ">
<tr>
<td width= "999 " height= "581 " valign= "top "> <table width= "999 " border= "0 " cellpadding= "0 " cellspacing= "0 ">
<tr>
<td width= "999 " height= "66 " > <table width= "999 " border= "0 " cellspacing= "0 " cellpadding= "0 ">
<tr>
<td> <img src= "image/top1_1.gif " width= "455 " height= "66 "> </td>
<td> <a href= "# "> <img src= "image/top1_2.gif " width= "59 " height= "66 " border= "0 "> </a> </td>
<td> <a href= "# "> <img src= "image/top1_3.gif " width= "62 " height= "66 " border= "0 "> </a> </td>
<td> <a href= "# "> <img src= "image/top1_4.gif " width= "61 " height= "66 " border= "0 "> </a> </td>
<td> <a href= "# "> <img src= "image/top1_5.gif " width= "58 " height= "66 " border= "0 "> </a> </td>
<td> <a href= "# "> <img src= "image/top1_6.gif " width= "63 " height= "66 " border= "0 "> </a> </td>
<td width= "243 " background= "image/top1_7.gif "> <div align= "center "> </div> </td>
<td> <a href= "index.jsp "> <img src= "image/top_button_sy.gif " border= "0 "> </a> </td>


<td> <a href= "logout.jsp "> <img src= "image/top_button_logout.gif " border= "0 "> </a> </td>
<td width= "76 "> <input name= "imageField2 " type= "image " src= "image/top_button_close1.gif " border= "0 " onClick= "stop() "> </td>
</tr>
</table> </td>
</tr>
<tr>

[解决办法]
<td height= "6 " valign= "top " bgcolor= "9BC2ED "> </td>
</tr>
<tr>
<td height= "551 " valign= "top " bgcolor= "9BC2ED "> <table width= "987 " border= "0 " cellspacing= "0 " cellpadding= "0 ">
<tr>
<td width= "6 ">   </td>
<td width= "987 "> <table width= "987 " border= "0 " align= "center " cellpadding= "0 " cellspacing= "0 ">
<tr>
<td width= "194 " height= "564 " valign= "top "> <table width= "193 " border= "0 " cellpadding= "0 " cellspacing= "0 ">
<tr>
<td width= "193 " height= "551 " valign= "top " bgcolor= "#F6F6F6 "> <table width= "193 " border= "0 " cellspacing= "0 " cellpadding= "0 ">
<tr>
<td width= "193 " height= "557 " valign= "top "> <table width= "190 " border= "0 " cellspacing= "0 " cellpadding= "0 ">
<tr>
<td width= "110 " height= "4 "> <font color= "#0000FF "> 当前用户为: <%=UsrID%> </font> </td>
</tr>
<%
try{

while(rs.next()){
%>
<tr> <td width= "110 " height= "4 ">
<font color= "#0000FF "> 工作平台 <%=rs.getString( "c_usr_id ")%> </font>
</td> </tr>
<%
}
if(rs!=null) {
rs.close();
}
}catch(Exception e){
e.printStackTrace();
conndb.closeRs();
conndb.closeStmt();
conndb.closeConn();
}%>

</table>
<table cellpadding=0 cellspacing=0 align=center>
<tr onmouseover=this.className= 'menu_title2 '; onmouseout=this.className= 'menu_title '; id=menuTitle22 onClick= "showsubmenu(22) " style= "cursor:hand; ">
<td width= "191 " height=25 class=menu_title>
<table width= "106 " border= "0 " align= "center " cellpadding= "0 " cellspacing= "0 ">


<tr>
<td width= "32 " height= "29 "> <img src= "image/12.jpg " width= "32 " height= "27 "> </td>
<td width= "74 ">   <a href= "# "> <span class= "STYLE1 "> 管理员系统 </span> </a> </td>
</tr>
<tr>
<td height= "1 " bgcolor= "#DBEBFD "> </td>
<td height= "1 " valign= "top " bgcolor= "#DBEBFD "> </td>
</tr>
</table> </td>
</tr>
<tr>
<td style= "display:none " id= 'submenu22 '>
<div class=sec_menu style= "width:190 ">
<table width= "191 " border= "0 " cellspacing= "0 " cellpadding= "0 ">
<tr>
<td width= "10 ">   </td>
<td width= "181 "> <table width= "82 " border= "0 " align= "center " cellpadding= "0 " cellspacing= "0 ">
<tr>
<td width= "19 " height= "29 "> <img src= "image/arrow.gif " width= "8 " height= "8 "> </td>
<td width= "63 ">   <a href= "UsrCX.jsp " target= "body "> <span class= "STYLE1 "> 人员管理 </span> </a> </td>
</tr>
<tr>
<td height= "1 " bgcolor= "#DBEBFD "> </td>
<td height= "1 " valign= "top " bgcolor= "#DBEBFD "> </td>
</tr>
</table>
<table width= "78 " border= "0 " align= "center " cellpadding= "0 " cellspacing= "0 ">
<tr>
<td width= "19 " height= "29 "> <img src= "image/arrow.gif " width= "8 " height= "8 "> </td>
<td width= "59 ">   <a href= "RoleCX.jsp " target= "body "> <span class= "STYLE1 "> 角色管理 </span> </a> </td>
</tr>
<tr>
<td height= "1 " bgcolor= "#DBEBFD "> </td>
<td height= "1 " valign= "top " bgcolor= "#DBEBFD "> </td>


</tr>
</table> </td>
</tr>
</table>
</div> </td>
</tr>
</table> </td>
</tr>
</table> </td>
</tr>
</table> </td>
<td width= "1 " bgcolor= "9BC2ED "> </td>
<td width= "792 " height= "564 " valign= "top " bgcolor= "#FFFFFF ">
<iframe align= "center " width= "767 " height= "564 " id= "body " name= "body " src= "1.htm " scrolling= "auto " hspace= "0 " frameborder= "0 "> </iframe> </td>
</tr>
</table> </td>
<td width= "10 ">   </td>
</tr>
</table> </td>
</tr>
</table> </td>
</tr>
</table>
</body>
</html>


[解决办法]
有没有错误提示?

读书人网 >Java Web开发

热点推荐