Page 203 - 捷運技術 第28期
P. 203

28         92    2                       197




                                                        sps                  cps                   dBs1
               dBs2



                      Jsp













                                                IE                          Java Applet

                         Jsp                       Resin 2.1.6   Resin           AP server   Jsp
                                           Browser    HTML                   GET     POST
                              SQL                                             HTML                Browser

                                                     (                             )





                    <TITLE>            </TITLE>
                    <%
                    String equ=request.getParameter( equipment );
                    Class.forName( sun.jdbc.odbc.JdbcOdbcDriver  );//
                    Connection con = DriverManager.getConnection(  jdbc:odbc:cpsDataBase  );
                    Statement     stmt     =     con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
               ResultSet.CONCUR_READ_ONLY);
                    String sql=  SELECT * FROM cpsalarm WHERE line  like   +  +lin+  + And equipment like   +
               +equ+   ;//   SQL
                    ResultSet rs = stmt.executeQuery(sql);
                            while(rs.next()) //  while
                           {        <TD><%= rs.getString(1) %></TD>
                    <TD><%= rs.getString(7) %></TD>
                      <%
                      rs.close(); //
                      stmt.close(); //  Statement
                      con.close(); //



                           Jsp
   198   199   200   201   202   203   204   205   206   207   208