⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dsthirdparty.jsp

📁 学生选课系统 赶快来下载啊啊好东西 呵呵啊啊 啊啊啊啊啊
💻 JSP
字号:
<%@ page contentType="text/html;charset=GBK" %>
<%@ page import="epod.setup.constant.*,epod.setup.*,epod.util.*"%>
<%@ include file="common.jsp" %>
<%@ taglib uri="/WEB-INF/epod-html.tld" prefix="epod" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Epod setup</title>
<link href="../lib/style.css" rel="stylesheet" type="text/css">
</head>
<%
	session.setAttribute("epod.setup.datasource","1");

	
	
	String ope = RequestUtil.getString(request,"operator","");
	String ds = RequestUtil.getString(request,"ds",EpodProperties.getConfig(SetupConstant.EPOD_PROPERTIES,"epod.database"));
	
	String driver = RequestUtil.getString(request,"driver",EpodProperties.getConfig(SetupConstant.EPOD_PROPERTIES,"epod.jdbc.driver"));
	String url = RequestUtil.getString(request,"url",EpodProperties.getConfig(SetupConstant.EPOD_PROPERTIES,"epod.jdbc.url"));
	String username = RequestUtil.getString(request,"username",EpodProperties.getConfig(SetupConstant.EPOD_PROPERTIES,"epod.jdbc.user"));
	String pwd = RequestUtil.getString(request,"pwd",EpodProperties.getConfig(SetupConstant.EPOD_PROPERTIES,"epod.jdbc.password"));
	String fetchsize = RequestUtil.getString(request,"fetchsize",EpodProperties.getConfig(SetupConstant.EPOD_PROPERTIES,"epod.fetchsize"));
	

	boolean test = true;
	if(ope.equals("0")){
		STDataSource datasourse = new STDataSource();
		test = datasourse.setDataSource(request);
		if(test){
			response.sendRedirect("createdb.jsp");
		}
	}

	pageContext.setAttribute("dsoptions", STDataSource.getDSOptions());

%>

<SCRIPT LANGUAGE="JavaScript">
<!--
var dsArr = <%=STDataSource.getDSArray()%>;
//-->
</SCRIPT>
<body>

<table cellpadding="0" cellspacing="0" align="center" width="100%">
  <tr>
    <td height="62" colspan="2">
	  <%@ include file="header.jsp" %>

	  </td>
  </tr>
  
  <tr valign="top">
    <td width="172" height="289">
	<%@ include file="sidebar.jsp" %>
    <p>&nbsp;</p></td>
    <td width="607">
	<form name="form1" method="post" action="dsthirdparty.jsp">
	<INPUT TYPE="hidden" name='operator' value=''>
	<table width="100%" border=0 cellpadding=1 cellspacing=1 class="unit_table">
      <tr class="page_desc">
        <td height="34" colspan="2" class="cell_null">标准数据库链接
		<%if(!test){%>
		<p>
			<font color=red>建立数据库链接失败,请确认输入数据库信息是否正确。</font>
		</p>
		<%}%>
		</td>
        </tr>
      <tr>
        <td width="33%" class="cell_right">Database Driver: &nbsp;
          </td>
        <td width="67%" class="cell_left">
		<epod:select property="ds" collection="dsoptions" onchange="setds(this)" optvalue="value" optname="lable"/>
		</td>
      </tr>
      <tr>
        <td class="cell_right">JDBC Driver Class: </td>
        <td class="cell_left"><input size=40 type="text" name="driver"></td>
      </tr>
      <tr>
        <td class="cell_right"> Database URL: </td>
        <td class="cell_left"><input size=40 type="text" name="url"></td>
      </tr>
      <tr>
        <td class="cell_right"> Username: </td>
        <td class="cell_left"><input type="text" name="username"></td>
      </tr>
      <tr>
        <td class="cell_right"> Password: </td>
        <td class="cell_left"><input type="password" name="pwd"></td>
      </tr>
      <tr>
        <td class="cell_right">Fetch Size: </td>
        <td class="cell_left"><input type="text" name="fetchsize"></td>
      </tr>
    </table>
	        <div align="right">
          <input type="button" name="button_setds" onclick="submitDS('0')" value="下一步">
        </div>
      </form>

    </td>
  </tr>
  <tr>
  <td colspan="2">
  	<%@ include file="footer.jsp" %>
  </td>
  </tr>
</table>

</body>

<SCRIPT LANGUAGE="JavaScript">
<!--
init();
function init(){
	document.all('url').value='<%=url%>';
	document.all('driver').value='<%=driver%>';
	document.all('username').value='<%=username%>';
	document.all('pwd').value='<%=pwd%>';
	document.all('fetchsize').value='<%=fetchsize%>';
	document.all('ds').value='<%=ds%>';
}

//setds(document.all('ds'));

function setds(obj){
	var v = obj.value;
	for(var i=0; i<dsArr.length; i++){
		if(dsArr[i][0]==v){
			document.all('driver').value=dsArr[i][1];
			document.all('url').value=dsArr[i][2];
			return;
		}
	}
}

function submitDS(ope){
	if(!inputCheck()) return;
	document.all('operator').value=ope;
	document.forms[0].submit();
}

function inputCheck(){
	if(document.all('driver').value==''){
		alert("Driver 不能为空");
		return false;
	}
	if(document.all('url').value==''){
		alert("URL 不能为空");
		return false;
	}
	return true;
}
//-->
</SCRIPT>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -