<%
/**
 *	$RCSfile: database.jsp,v $
 *	$Revision: 1.1.1.1 $
 *	$Date: 2002/09/09 13:50:25 $
 */
%>

<%@ page 
	import="java.sql.*,
            com.jivesoftware.forum.*,
            com.jivesoftware.forum.util.*,
            com.jivesoftware.forum.database.*"%>

<%@	include file="include/global.jsp" %>

<%@ include file="include/header.jsp" %>

<p>

<%  // Title of this page and breadcrumbs
    String title = "Database Settings";
    String[][] breadcrumbs = {
        {"Main", "main.jsp"},
        {"Database Settings", "database.jsp"}
    };
%>
<%@ include file="include/title.jsp" %>

<font size="-1">
Below is a summary of your database settings. If you need to change them,
you'll need to edit your jive_config.xml file.
</font>

<p>

<% 
	boolean error = false;
	DatabaseMetaData metaData = null;
	Connection con = null;
	if (!error) {
		try {
			con = ConnectionManager.getConnection();
			metaData = con.getMetaData();
		}
		catch( Exception e ) { 
			e.printStackTrace();
		}
	}
%>

<%
	if (!error) {
		try {
%>

<font size="-1"><b>Database Properties</b></font>

<ul>

<table bgcolor="<%= tableBorderColor %>" cellpadding="0" cellspacing="0" border="0" width="300">
<tr><td>
<table bgcolor="<%= tableBorderColor %>" cellpadding="3" cellspacing="1" border="0" width="100%">
<tr bgcolor="#ffffff">
    <td><font size="-1">Name:</font></td>
    <td><font size="-1"><%= metaData.getDatabaseProductName() %></font></td>
</tr>
<tr bgcolor="#ffffff">
    <td><font size="-1">Version:</font></td>
    <td><font size="-1"><%= metaData.getDatabaseProductVersion() %></font></td>
</tr>
</table>
</td></tr>
</table>

</ul>

<font size="-1"><b>JDBC Driver Properties</b></font>

<ul>

<table bgcolor="<%= tableBorderColor %>" cellpadding="0" cellspacing="0" border="0" width="300">
<tr><td>
<table bgcolor="<%= tableBorderColor %>" cellpadding="3" cellspacing="1" border="0" width="100%">
<tr bgcolor="#ffffff">
    <td><font size="-1">Driver:</font></td>
    <td><font size="-1"><%= metaData.getDriverName() %>, version <%= metaData.getDriverVersion() %></font></td>
</tr>
<tr bgcolor="#ffffff">
    <td><font size="-1">Connection URL:</font></td>
    <td><font size="-1"><%= metaData.getURL() %></font></td>
</tr>
<tr bgcolor="#ffffff">
    <td><font size="-1">Connection username:</font></td>
    <td><font size="-1"><%= metaData.getUserName() %></font></td>
</tr>
</table>
</td></tr>
</table>

</ul>

<font size="-1"><b>Database Capabilities</b></font>

<ul>

<table bgcolor="<%= tableBorderColor %>" cellpadding="0" cellspacing="0" border="0" width="300">
<tr><td>
<table bgcolor="<%= tableBorderColor %>" cellpadding="3" cellspacing="1" border="0" width="100%">
<tr bgcolor="#ffffff">
    <td><font size="-1">Supports transactions?</font></td>
    <td><font size="-1"><%= (metaData.supportsTransactions())?"Yes":"No" %></font></td>
</tr>
<tr bgcolor="#ffffff">
    <td><font size="-1">Supports multiple connections <br>open at once?</font></td>
    <td><font size="-1"><%= (metaData.supportsMultipleTransactions())?"Yes":"No" %></font></td>
</tr>
<tr bgcolor="#ffffff">
    <td><font size="-1">Is in read-only mode?</font></td>
    <td><font size="-1"><%= (metaData.isReadOnly())?"Yes":"No" %></font></td>
</tr>
</table>
</td></tr>
</table>

</ul>

<%			con.close();
		}
		catch( Exception e ) {}
	}
%>

</body>
</html>


