论文首页哲学论文经济论文法学论文教育论文文学论文历史论文理学论文工学论文医学论文管理论文艺术论文 |
4)全局ER模式的优化
在得到全局ER模式后,为了提高数据库系统的效率,还应进一步依据处理需求对ER模式进行优化。一个好的全局ER模式,除能准确、全面地反映用户功能需求外,还应满足下列条件:实体类型的个数要尽可能的少;实体类型所含属性个数尽可能少;实体类型间联系无冗余。
4.3.2设计
由于概念设计的结果是ER图,DBMS一般采用关系型,因此数据库的逻辑设计过程就是把ER图转化为关系模式的过程。由于关系模型古有的优点,逻辑设计可以充分运用关系数据库规范化理论,使设计过程形式化地进行。设计结果是一组关系模式的定义。
1)导出初始关系模式
2)关系子模式
子模式是用户所用到的那部分数据的描述。除了指出用户用到的数据外,还应指出数据与概念模式中相应数据的联系,即指出概念模式与子模式之间的对应性。
第五章 公交查询系统应用程序设计(部分)§5.1查询模块的功能实现
<%@ page contentType="text/html; charset=ISO8859_1" %>
<%@ page import="java.sql.*,java.util.*,com.lanyuer.util.*;" %>
<%
List routes = null;
Connection connection;
com.lanyuer.route.route_Manager route_Manager = com.lanyuer.route.route_Manager.getInstance();
connection = DataConnectionManager.getInstance().getConnection();
try {
routes = route_Manager.selectes(connection);
} catch (Exception e) {
throw e;
} finally {
if (connection != null) {
connection.close();
connection = null;
}
}
%>
<html>
<head>
<title>公交查询</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO8859_1">
</head>
<SCRIPT language=JAVASCRIPT type=text/javascript>
<!--
function loginSubmit(theObj)
{
if (theObj.fromStep.value == "" && theObj.toStep.value != "")
{
alert("始发站不能为空");
theObj.fromStep.focus();
return false;
}
else if (theObj.fromStep.value != "" && theObj.toStep.value == "")
{
alert("终点站不能为空");
theObj.toStep.focus();
return false;
}
else if (theObj.fromStep.value == "" && theObj.toStep.value == "")
{
alert("始发站和终点站不能为空");
theObj.fromStep.focus();
return false;
}
return true;
}
// -->
</SCRIPT>
<link rel="STYLESHEET" type="text/css" href="../css/all.css">
<style type="text/css">
<!--
body { font-size: 9pt}
table { font-size: 9pt}
a:active { font-size: 9pt; color: #000000;}
A:hover { font-size: 9pt; COLOR: #000000; TEXT-DECORATION: none}
a:link { font-size: 9pt; color: #000000;}
a:visited { font-size: 9pt; color: #000000;}
-->
</style>
<body bgcolor="#000000" text="#000000" topmargin="0" leftmargin="0" background="../image/back.gif">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" height="100%" align="center">
<table width="600" height="400" border="0" cellspacing="0" cellpadding="0" background="../image/login_bg.jpg">
<tr>
<td height="100%" width="100%" align="center" valign="top">
<table width="200" border="0" cellspacing="0" cellpadding="0">
<form name="login" method="post" action="selectStep.jsp" target="_parent" onsubmit="return loginSubmit(this)">
<tr>
<td height="120" align="center" colspan="2">
</td>
</tr>
<tr>
<td height="24">始发站</td>
<td height="24"><font color="#FFFFFF">
<input type="text" name="fromStep" size="16" maxlength="16" class=myinput2 value="">
</font> </td>
</tr>
<tr>
<td height="24">终点站</td>
<td height="24"><font color="#FFFFFF">
<input name="toStep" type="text" size="16" maxlength="16" class=myinput2 value="">
</font> </td>
</tr>
<tr>
<td height="30"> </td>
<td height="30">
<input type="submit" value=" 提交 " class="myinput">
<input type="reset" value=" 重填 " class="myinput">
</td>
</tr>
</form>
<form name="login" method="get" action="route.jsp" target="_parent">
<tr>
<td height="24">线 路</td>
<td height="24">
<select name="cRouteCode" style="width:110px">
<%
Iterator iterator = routes.iterator();
while(iterator.hasNext()) {
com.lanyuer.route.route route = (com.lanyuer.route.route)iterator.next();
%>
<option value="<%=route.getcRouteCode()%>"><%=route.getcRouteCode()%>路</option>
<%
}
%>
</select>
</td>
</tr>
<tr>
<td height="30"> </td>
<td height="30">
<input type="submit" value=" 提交 " class="myinput">
</td>
</tr>
</form>
</table>
</td>
</tr>
<tr>
<td height="180" align="center">
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>