dbInfo.jsp
资源名称:NetOffice.rar [点击查看]
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:3k
源码类别:
电子政务应用
开发平台:
Java
- <%
- /**
- * $RCSfile: dbInfo.jsp,v $
- * $Revision: 1.3 $
- * $Date: 2000/12/18 02:06:21 $
- */
- %>
- <%@ page
- import="java.sql.*,
- com.coolservlets.forum.*,
- com.coolservlets.forum.database.*"%>
- <jsp:useBean id="adminBean" scope="session"
- class="com.coolservlets.forum.util.admin.AdminBean"/>
- <% ////////////////////////////////
- // Jive authorization check
- // check the bean for the existence of an authorization token.
- // Its existence proves the user is valid. If it's not found, redirect
- // to the login page
- Authorization authToken = adminBean.getAuthToken();
- if( authToken == null ) {
- response.sendRedirect( "/mainctrl/bbs/admin" );
- return;
- }
- %>
- <html>
- <head>
- <title>数据库信息</title>
- <link rel="stylesheet" href="style/global.css">
- </head>
- <body background="images/shadowBack.gif" bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
- <%-- header --%>
- <table class="pageHeaderBg" cellpadding="1" cellspacing="0" border="0" width="100%">
- <td><table class="pageHeaderFg" cellpadding="3" cellspacing="0" border="0" width="100%">
- <td>
- <span class="pageHeaderText">
- 数据库信息
- </span>
- </td>
- </table></td>
- </table>
- <%-- /header --%>
- <p>
- <%
- boolean error = false;
- DatabaseMetaData metaData = null;
- Connection con = null;
- if (!error) {
- try {
- con = DbConnectionManager.getConnection();
- metaData = con.getMetaData();
- }
- catch( Exception e ) {
- e.printStackTrace();
- }
- }
- %>
- <%
- if (!error) {
- try {
- %>
- <b>数据库信息</b>
- <ul>
- <table cellpadding="2" cellspacing="2" border="0">
- <tr>
- <td colspan="2"><font size="-1"><b>数据库属性</b></font></td>
- </tr>
- <tr>
- <td bgcolor="#eeeeee"><font size="-1">名称:</font></td>
- <td><font size="-1"><%= metaData.getDatabaseProductName() %></font></td>
- </tr>
- <tr>
- <td bgcolor="#eeeeee"><font size="-1">版本:</font></td>
- <td><font size="-1"><%= metaData.getDatabaseProductVersion() %></font></td>
- </tr>
- <tr>
- <td colspan="2"><br><b><font size="-1">JDBC驱动属性</font></b></td>
- </tr>
- <tr>
- <td bgcolor="#eeeeee"><font size="-1">驱动:</font></td>
- <td><font size="-1"><%= metaData.getDriverName() %>, version <%= metaData.getDriverVersion() %></font></td>
- </tr>
- <tr>
- <td bgcolor="#eeeeee"><font size="-1">连接符:</font></td>
- <td><font size="-1"><%= metaData.getURL() %></font></td>
- </tr>
- <tr>
- <td bgcolor="#eeeeee"><font size="-1">连接用户名:</font></td>
- <td><font size="-1"><%= metaData.getUserName() %></font></td>
- </tr>
- <tr>
- <td colspan="2"><br><b><font size="-1">数据库性能</font></b></td>
- </tr>
- <tr>
- <td bgcolor="#eeeeee"><font size="-1">支持事务处理?</font></td>
- <td><font size="-1"><%= (metaData.supportsTransactions())?"是":"否" %></font></td>
- </tr>
- <tr>
- <td bgcolor="#eeeeee"><font size="-1">支持多链接?</font></td>
- <td><font size="-1"><%= (metaData.supportsMultipleTransactions())?"是":"否" %></font></td>
- </tr>
- <tr>
- <td bgcolor="#eeeeee"><font size="-1">只读模式?</font></td>
- <td><font size="-1"><%= (metaData.isReadOnly())?"是":"否" %></font></td>
- </tr>
- </table>
- <% con.close();
- }
- catch( Exception e ) {}
- }
- %>
- </body>
- </html>