• 沒有找到結果。

7 結論與未來研究方向

7.2 未來研究方向

1、多行 SQL 敘述的連結方式

可再擴充系統設定資料表(CONJ),使系統可辨識多種的字串連結符號,其 它程式語言如 Java、PHP 等亦可以此法進行擴充剖析。

2、執行的 SQL 敘述中內含多個 SQL 敘述

可加強剖析執行的 SQL 敘述中內含多個 SQL 敘述的情形。

3、資料表及欄位使用變數

對於 SQL 敘述中使用變數的情形,目前並無法辦識,未來研究或許可搭配 一些工具(如 SQL Server 的 Profiler)於執行時期(run time),擷取執行時的 SQL 敘 述進行剖析。

4、資料讀取的敘述

本研究只針對造成資料異動的資料庫操作語言,即新增(INSERT)、修改 (UPDATE)及刪除(DELETE),未來的研究可思考加入剖析資料讀取(SELECT)的 SQL 敘述。

參考文獻

[1] Beier, J. & Tesche, T. (2000). Navigation and Interaction in Medical

Knowledge Spaces Using Topic Maps. International Congress Series, 1230, 384-388.

[2] Biezunski, M. (2003). Introduction to the Topic Maps Paradigm. In J.

Park & S. Hunting (Ed.), XML Topic Maps: Creating and Using Topic Maps for t he Web (pp.17-30). Boston: Addison-Wesley.

[3] DeRose, S., Maler, E., Orchard, D. (2001). XML Linking Language

(XLink) Version 1.0. Available at: http://www.w3.org/TR/xlink/ (June 14, 2005) [4] Garshol, L. M., Barta, R., JTC1/SC34. (2005). Topic Maps Query

Language. Available at: http://www.isotopicmaps.org/tmql/spec.html (May 18, 2005)

[5] Lars Marius Garshol. What Are Topic Maps. Available at:

http://www.xml.com/pub/a/2002/09/11/topicmaps.html?page=2.

[6] Member of the TopicMaps.Org Authoring Group. (2001). XML

Topic Maps ( XTM ) v1.0. Available at: http://www.topicmaps.org/xtm/1.0/

(May19, 2005)

[7] Moore, G., Bogachev, D., Nishikawa, M., JTC1/SC34. (2005). Topic Maps Constraint Language. Available at:

http://www.isotopicmaps.org/tmcl/tmcl-2005-02-12.html (May 18, 2005) [8] Navathe & Elmasri (2003). Fundamentals of Database Systems, Fourth Edition

(p.268). Addison Wesley.

[9] Omnigator, Topic Maps Tool. Available at:

http://www.ontopia.net/omnigator/models/index.jsp.

[10] Pepper, S. (2000). The TAO of Topic Maps: Finding the Way in the Age of

Infoglut. Available at: http://www.ontopia.net/topicmaps/materials/tao.html (June 2, 2005)

[11] Pepper S., & Garshol, L. M. (2002). The XML Papers: Lessons on Applying Topic Maps. IDEAlliance XML 2002 Conference, Baltimore.

[12] TopicMaps.Org. Topic Maps standard [ISO13250]. Available at:

http://www.topicmaps.org/.

[13] SQL語句語法。Available at:http://twpug.net/docs/mysql-5.1/sql-syntax.html [14] SQL簡介,Available at:http://dyna.hcc.edu.tw/php/class4_3.htm

[15] SQL 關鍵字. Available at:

http://www.php5.idv.tw/documents/pgsqldoc-7.3tw/sql-keywords-appendix.html [16]內嵌式 SQL. Available at:

http://www.dbmaker.com.tw/prodinfo/dbmaker/d-teach/paper12.html [17]林信成、歐陽慧、歐陽崇榮 (2004)。以主題地圖建構索引典之語意網路

模型。圖書與資訊學刊,48,35-56。

[18]卓素珍(2003)。資料存取技術發展,「網頁資料庫」教學設計與應用之研究。

[19]施威銘研究室(2006),SQL Server 2005 設計實務,旗標股份有限公司 [20]胡大雄(2002),資料庫系統開放式界面-ODBC,Available at:

http://www.dbmaker.com.tw/reference/issue/dbmaiss5.html#pic1

[21]胡百敬(2006),SQL Server 2005 資料庫開發聖經,學貫行銷股份有限公司

附錄 A:程式碼剖析及 XTM 匯出之原始碼

Private Function checkExistData(ByVal sFileName As String, ByVal sKeyWord As String, ByVal sKItem As String, ByVal nLine As Integer, ByVal sDir As String) As Integer

sc = ""

If rb_type.Checked = True Then

sc = "select * from PSCT where psc_sc='" & sFileName & "' and psc_type='" &

sKeyWord & "' and psc_table='" & sKItem & "' and psc_line=" & nLine & ""

Else

sc = "select * from PSCT where psc_sc='" & sFileName & "' and psc_type='" &

sKeyWord & "' and psc_table='" & sKItem & "' and psc_line=" & nLine & " and psc_dir='" & sDir &

"'"

checkExistData = ds.Tables("PSCT").Rows(0).Item("psc_id") Else

checkExistData = 0 End If

End Function

Private Function checkExistField(ByVal nID As Integer, ByVal sFName As String) As Boolean sc = ""

Private Sub insertData(ByVal sFileName As String, ByVal sKeyWord As String, ByVal sKItem As String, ByVal nLine As Integer, ByVal sDir As String, ByVal sRefData As String, ByVal sRefUrl As String)

ic = ""

If rb_type.Checked = True Then ic = "insert into PSCT

(psc_sc,psc_type,psc_table,psc_line,psc_flag,psc_dir,psc_sysname,psc_filetype,psc_refdata,psc_refurl) values ('" & sFileName & "','" & sKeyWord & "','" & sKItem & "'," & nLine & ",'FILE','" & sDir &

"','" & tb_name.Text & "','" & cb_FileType.Text & "','" & sRefData & "','" & sRefUrl & "')"

Else

ic = "insert into PSCT

(psc_sc,psc_type,psc_table,psc_line,psc_flag,psc_dir,psc_sysname,psc_filetype,psc_refdata,psc_refurl) values ('" & sFileName & "','" & sKeyWord & "','" & sKItem & "'," & nLine & ",'DIR','" & sDir & "','"

& tb_name.Text & "','" & cb_FileType.Text & "','" & sRefData & "','" & sRefUrl & "')"

End If

Dim cmd As SqlCommand = New SqlCommand(ic, cn) cmd.ExecuteNonQuery()

End Sub

Private Sub insertField(ByVal nID As Integer, ByVal sFName As String) ic = ""

getIdentity = ds.Tables("identity").Rows(0).Item(0) End Function

Private Sub parseKeyword(ByVal sStr As String, ByVal sFileName As String, ByVal nLine As Integer, ByVal sDir As String, ByVal sRefData As String, ByVal sRefUrl As String)

str1 = ""

arr_f1 = str2.Split(")")

End If

sRefData = ""

Private Sub parsing(ByVal fFileInfo As FileInfo, ByVal sDir As String) Dim sStr As String

End If

Private Function getSConj(ByVal c_sType As String) As String Dim sc As String

sc = "select * from CONJ where c_sType='" & c_sType & "'"

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

sb.Append("<?xml version=""1.0"" encoding=""utf-8"" standalone=""yes""?>") sb.Append("<topicMap xmlns=""http://www.topicmaps.org/xtm/1.0/""

xmlns:xlink=""http://www.w3.org/1999/xlink"" id=""SCPE"">") sb.Append("<topic id=""Source"">")

sb.Append("<baseName>")

sb.Append("<baseNameString>程式碼</baseNameString>") sb.Append("</baseName>")

sb.Append("</topic>")

Private Sub writeXTM(ByVal SysName As String, ByVal sbXTM As StringBuilder) Dim sw As New StreamWriter("C:\" & SysName & ".xtm")

sw.Write(sbXTM.ToString) sw.Close()

End Sub

Private Sub exportXTM(ByVal SysName As String)

preXTM()

SysName & "' and psc_sc='" & ds.Tables("psc_sc").Rows(i).Item("psc_sc") & "' "

Dim da_ref As SqlDataAdapter = New SqlDataAdapter(sc, cn)

ds_ref.Tables("ref").Rows(0).Item("psc_sc") & "(程式碼說明)" & "</baseNameString>") sb.Append("</baseName>")

ds_ref.Tables("ref").Rows(0).Item("psc_sc") & "(程式碼說明)" & "</baseNameString>") sb.Append("</baseName>")

sb.Append("<occurrence>") sb.Append("<instanceOf>")

sb.Append("<topicRef xlink:href=""#NoteURL""/>")

sb.Append("</instanceOf>") psc_sysname='" & SysName & "' and psc_table='" &

ds.Tables("psc_table").Rows(i).Item("psc_table") & "') order by f_fname"

Dim da3 As SqlDataAdapter = New SqlDataAdapter(sc, cn)

sb.Append("</member>") sb.Append("</association>") End If

sc = "select distinct psc_sc from psct where psc_type='INSERT' and psc_sysname='" &

SysName & "' and psc_table='" & ds.Tables("psc_table").Rows(i).Item("psc_table") & "'"

Dim da4 As SqlDataAdapter = New SqlDataAdapter(sc, cn)

SysName & "' and psc_table='" & ds.Tables("psc_table").Rows(i).Item("psc_table") & "'"

Dim da5 As SqlDataAdapter = New SqlDataAdapter(sc, cn)

sc = "select distinct psc_sc from psct where psc_type='DELETE' and psc_sysname='" &

SysName & "' and psc_table='" & ds.Tables("psc_table").Rows(i).Item("psc_table") & "'"

Dim da6 As SqlDataAdapter = New SqlDataAdapter(sc, cn)

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

附錄 B:Web 查詢過濾介面之原始碼

B.1 查詢列表頁

Imports System.Data

Imports System.Data.SqlClient Public Class task_search Inherits System.Web.UI.Page

Dim cn As New SqlConnection(ConfigurationSettings.AppSettings("ConnString")) Protected WithEvents ButtonSearch As System.Web.UI.WebControls.Button

Protected WithEvents HyperLinkSearchDetail As System.Web.UI.WebControls.HyperLink Protected WithEvents DataGrid1 As System.Web.UI.WebControls.DataGrid

Protected WithEvents LabelResult As System.Web.UI.WebControls.Label Protected WithEvents lblMessage As System.Web.UI.WebControls.Label Protected WithEvents RecordStatus As System.Web.UI.WebControls.Label Protected WithEvents cnt As System.Web.UI.WebControls.TextBox Protected WithEvents ddl1 As System.Web.UI.WebControls.DropDownList Protected WithEvents lb1 As System.Web.UI.WebControls.LinkButton Protected WithEvents lb2 As System.Web.UI.WebControls.LinkButton Protected WithEvents lb3 As System.Web.UI.WebControls.LinkButton Protected WithEvents lb4 As System.Web.UI.WebControls.LinkButton Protected WithEvents Panel1 As System.Web.UI.WebControls.Panel Protected WithEvents lb_nodata As System.Web.UI.WebControls.Label Protected WithEvents tb_keyword As System.Web.UI.WebControls.TextBox Protected WithEvents tb_sysname As System.Web.UI.WebControls.TextBox Protected WithEvents rbl_type As System.Web.UI.WebControls.RadioButtonList Protected WithEvents rbl_access As System.Web.UI.WebControls.RadioButtonList Dim selectCmd As String

Dim tableTask As DataTable

Sub ChangePerRecord(ByVal sender As Object, ByVal e As EventArgs) If IsNumeric(cnt.Text) Then

Sub PageChange(ByVal sender As Object, ByVal e As CommandEventArgs) If e.CommandArgument.ToString = "first" Then '第一頁

End Sub

Private Sub ddl1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ddl1.SelectedIndexChanged

DataGrid1.CurrentPageIndex = Integer.Parse(ddl1.SelectedItem.Value) - 1 DataGrid1.EditItemIndex = -1

Public Function bindSearch() As DataTable

selectCmd = "select * from psct where psc_id>0 "

Private Sub ButtonSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSearch.Click

Private Sub DataGrid1_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.DataBinding

If DataGrid1.CurrentPageIndex > tableTask.Rows.Count \ cnt.Text Then DataGrid1.CurrentPageIndex = 0

Inherits System.Web.UI.Page

Protected WithEvents lblMessage As System.Web.UI.WebControls.Label Protected WithEvents RecordStatus As System.Web.UI.WebControls.Label Protected WithEvents cnt As System.Web.UI.WebControls.TextBox Protected WithEvents ddl1 As System.Web.UI.WebControls.DropDownList Protected WithEvents lb1 As System.Web.UI.WebControls.LinkButton Protected WithEvents lb2 As System.Web.UI.WebControls.LinkButton Protected WithEvents lb3 As System.Web.UI.WebControls.LinkButton Protected WithEvents lb4 As System.Web.UI.WebControls.LinkButton Protected WithEvents Panel1 As System.Web.UI.WebControls.Panel Protected WithEvents DataGrid1 As System.Web.UI.WebControls.DataGrid Protected WithEvents l_sysname As System.Web.UI.WebControls.Label Protected WithEvents l_sc As System.Web.UI.WebControls.Label Protected WithEvents l_table As System.Web.UI.WebControls.Label Protected WithEvents l_line As System.Web.UI.WebControls.Label Protected WithEvents l_access As System.Web.UI.WebControls.Label Protected WithEvents l_path As System.Web.UI.WebControls.Label Private designerPlaceholderDeclaration As System.Object

Dim cn As New SqlConnection(ConfigurationSettings.AppSettings("ConnString")) Sub ChangePerRecord(ByVal sender As Object, ByVal e As EventArgs)

If IsNumeric(cnt.Text) Then

Sub PageChange(ByVal sender As Object, ByVal e As CommandEventArgs) If e.CommandArgument.ToString = "first" Then '第一頁

End If

DataGrid1.EditItemIndex = -1 Call bindSearch(Request("sid")) End Sub

Private Sub ddl1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ddl1.SelectedIndexChanged

DataGrid1.CurrentPageIndex = Integer.Parse(ddl1.SelectedItem.Value) - 1 DataGrid1.EditItemIndex = -1

Call bindSearch(Request("sid")) End Sub

Private Sub bindSearch(ByVal sid As Integer) Dim sc As String

l_sysname.Text = ds.Tables("main").Rows(0).Item("psc_sysname") l_sc.Text = ds.Tables("main").Rows(0).Item("psc_sc")

l_table.Text = ds.Tables("main").Rows(0).Item("psc_table") l_line.Text = ds.Tables("main").Rows(0).Item("psc_line") l_access.Text = ds.Tables("main").Rows(0).Item("psc_type") l_path.Text = ds.Tables("main").Rows(0).Item("psc_dir")

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

附錄 C:XTM 檔案範例

<baseNameString>程式碼</baseNameString>

</baseName>

</topic>

<topic id="Table">

<baseName>

<baseNameString>資料表</baseNameString>

</baseName>

</topic>

<topic id="INSERT">

<baseName>

<baseNameString>新增</baseNameString>

</baseName>

</topic>

<topic id="UPDATE">

<baseName>

<baseNameString>修改</baseNameString>

</baseName>

</topic>

<topic id="DELETE">

<baseName>

<baseNameString>刪除</baseNameString>

</baseName>

</topic>

<topic id="locate">

<baseName>

<baseNameString>位於</baseNameString>

</baseName>

</topic>

<topic id="exist">

<baseName>

<baseNameString>存在</baseNameString>

</baseName>

</topic>

<topic id="Field">

<baseName>

<baseNameString>欄位</baseNameString>

</baseName>

</topic>

<topic id="Note">

<baseName>

<baseNameString>程式碼說明</baseNameString>

</baseName>

</topic>

<topic id="NoteURL">

<baseName>

<baseNameString>程式碼說明連結</baseNameString>

</baseName>

</topic>

<topic id="SourcePath">

<baseName>

<baseNameString>程式碼來源路徑</baseNameString>

</baseName>

</topic>

<topic id="calendar_delete.aspx.vb">

<instanceOf>

<topicRef xlink:href="#Source"/>

</instanceOf>

<baseName>

<baseNameString>calendar_delete.aspx.vb</baseNameString>

</baseName>

</topic>

<topic id="calendar_examine.aspx.vb">

<instanceOf>

<topicRef xlink:href="#Source"/>

</instanceOf>

<baseName>

<baseNameString>calendar_examine.aspx.vb</baseNameString>

</baseName>

</topic>

<topic id="calendar_modify.aspx.vb">

<instanceOf>

<topicRef xlink:href="#Source"/>

</instanceOf>

<baseName>

<baseNameString>calendar_modify.aspx.vb</baseNameString>

</baseName>

</topic>

<topic id="calendar_new.aspx.vb">

<instanceOf>

<topicRef xlink:href="#Source"/>

</instanceOf>

<baseName>

<baseNameString>calendar_new.aspx.vb</baseNameString>

</baseName>

</topic>

<topic id="calendar_new1.aspx.vb">

<instanceOf>

<topicRef xlink:href="#Source"/>

</instanceOf>

<baseName>

<baseNameString>calendar_new1.aspx.vb</baseNameString>

</baseName>

</topic>

<topic id="calendar_search_list.aspx.vb">

<instanceOf>

<topicRef xlink:href="#Source"/>

</instanceOf>

<baseName>

<baseNameString>calendar_search_list.aspx.vb</baseNameString>

</baseName>

</topic>

<topic id="calendar_view.aspx.vb">

<instanceOf>

<topicRef xlink:href="#Source"/>

</instanceOf>

<baseName>

<baseNameString>calendar_view.aspx.vb</baseNameString>

</baseName>

</topic>

<topic id="calendar_workflow.aspx.vb">

<instanceOf>

<topicRef xlink:href="#Source"/>

</instanceOf>

<baseName>

<baseNameString>calendar_workflow.aspx.vb</baseNameString>

</baseName>

</topic>

<topic id="calendar_workflow_modify.aspx.vb">

<instanceOf>

<topicRef xlink:href="#Source"/>

</instanceOf>

<baseName>

<baseNameString>calendar_workflow_modify.aspx.vb</baseNameString>

</baseName>

</topic>

<topic id="CALENDAR_LOG">

<instanceOf>

<topicRef xlink:href="#Table"/>

</instanceOf>

<baseName>

<baseNameString>CALENDAR_LOG</baseNameString>

</baseName>

</topic>

<topic id="CHECK_STATUS">

<baseName>

<baseNameString>CHECK_STATUS</baseNameString>

</baseName>

</topic>

<topic id="ID">

<baseName>

<baseNameString>ID</baseNameString>

</baseName>

</topic>

<topic id="MODIFY_DATE">

<baseName>

<baseNameString>MODIFY_DATE</baseNameString>

</baseName>

</topic>

<topic id="MODIFY_USER">

<baseName>

<baseNameString>MODIFY_USER</baseNameString>

</baseName>

</topic>

<association>

<instanceOf>

<topicRef xlink:href="#Field"/>

</instanceOf>

<member>

<roleSpec>

<topicRef xlink:href="#locate"/>

</roleSpec>

<topicRef xlink:href="#CALENDAR_LOG"/>

</member>

<member>

<roleSpec>

<topicRef xlink:href="#exist"/>

</roleSpec>

<topicRef xlink:href="#CHECK_STATUS"/>

<topicRef xlink:href="#ID"/>

<topicRef xlink:href="#MODIFY_DATE"/>

<topicRef xlink:href="#MODIFY_USER"/>

</member>

</association>

<association>

<instanceOf>

<topicRef xlink:href="#INSERT"/>

</instanceOf>

<member>

<roleSpec>

<topicRef xlink:href="#locate"/>

</roleSpec>

<topicRef xlink:href="#calendar_examine.aspx.vb"/>

<topicRef xlink:href="#calendar_modify.aspx.vb"/>

<topicRef xlink:href="#calendar_new.aspx.vb"/>

<topicRef xlink:href="#calendar_new1.aspx.vb"/>

<topicRef xlink:href="#calendar_workflow_modify.aspx.vb"/>

</member>

<member>

<roleSpec>

<topicRef xlink:href="#exist"/>

</roleSpec>

<topicRef xlink:href="#CALENDAR_LOG"/>

</member>

</association>

<topic id="CALENDAR_NEW">

<instanceOf>

<topicRef xlink:href="#Table"/>

</instanceOf>

<baseName>

<baseNameString>CALENDAR_NEW</baseNameString>

</baseName>

</topic>

<topic id="APPLY_DATE">

<baseName>

<baseNameString>APPLY_DATE</baseNameString>

</baseName>

</topic>

<topic id="APPLY_USER">

<baseName>

<baseNameString>APPLY_USER</baseNameString>

</baseName>

</topic>

<topic id="ATTENDEES">

<baseName>

<baseNameString>ATTENDEES</baseNameString>

</baseName>

</topic>

<topic id="ATTENDEES_OUT">

<baseName>

<baseNameString>ATTENDEES_OUT</baseNameString>

</baseName>

</topic>

<topic id="CATE">

<baseName>

<baseNameString>CATE</baseNameString>

</baseName>

</topic>

<topic id="CHECK_STATUS">

<baseName>

<baseNameString>CHECK_STATUS</baseNameString>

</baseName>

</topic>

<topic id="CHECKER">

<baseName>

<baseNameString>CHECKER</baseNameString>

</baseName>

</topic>

<topic id="CONTACTS_PERSON">

<baseName>

<baseNameString>CONTACTS_PERSON</baseNameString>

</baseName>

</topic>

<topic id="CONTENT">

<baseName>

<baseNameString>CONTENT</baseNameString>

</baseName>

</topic>

<topic id="DEP">

<baseName>

<baseNameString>DEP</baseNameString>

</baseName>

</topic>

<topic id="DISPLAYNAME">

<baseName>

<baseNameString>DISPLAYNAME</baseNameString>

</baseName>

</topic>

<topic id="ENDTIME">

<baseName>

<baseNameString>ENDTIME</baseNameString>

</baseName>

</topic>

<topic id="HOST">

<baseName>

<baseNameString>HOST</baseNameString>

</baseName>

</topic>

<topic id="ID">

<baseName>

<baseNameString>ID</baseNameString>

</baseName>

</topic>

<topic id="IF_DEL">

<baseName>

<baseNameString>IF_DEL</baseNameString>

</baseName>

</topic>

<topic id="IF_PUB">

<baseName>

<baseNameString>IF_PUB</baseNameString>

</baseName>

</topic>

<topic id="INSTANCE">

<baseName>

<baseNameString>INSTANCE</baseNameString>

</baseName>

</topic>

<topic id="LOCATION">

<baseName>

<baseNameString>LOCATION</baseNameString>

</baseName>

</topic>

<topic id="MODIFY_TIME">

<baseName>

<baseNameString>MODIFY_TIME</baseNameString>

</baseName>

</topic>

<topic id="MODIFY_USER">

<baseName>

<baseNameString>MODIFY_USER</baseNameString>

</baseName>

</topic>

<topic id="PUB_TO">

<baseName>

<baseNameString>PUB_TO</baseNameString>

</baseName>

</topic>

<topic id="STARTTIME">

<baseName>

<baseNameString>STARTTIME</baseNameString>

</baseName>

</topic>

<topic id="SUBJECT">

<baseName>

<baseNameString>SUBJECT</baseNameString>

</baseName>

</baseName>

相關文件