SAK }‘ŠÙ

SAK Streets ƒƒCƒ“ƒXƒgƒŠ[ƒg }‘ŠÙEƒJƒtƒF ˆê—— SAK Streets ŒŸõ
| VB | SQL | Perl | PHP | ASP | JSP | C | PC | HP | FAQ | ƒtƒŠ[ƒ\ƒtƒg |

JAVA ServletAJSP + Oracle9i •Ò6 - JDBCAƒe[ƒuƒ‹\‘¢ƒŠƒXƒgˆê——•\Ž¦

¡ƒe[ƒuƒ‹\‘¢ƒŠƒXƒgˆê——•\Ž¦

  EŠeƒe[ƒuƒ‹‚̃e[ƒuƒ‹\‘¢ƒŠƒXƒgˆê——‚ð•\Ž¦‚·‚é‚É‚ÍAŽŸ‚̂悤‚É‚·‚éB

<%@ page import="java.util.*,java.sql.*,java.text.*;" contentType="text/html; charset=Shift_JIS"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<TITLE>ƒe[ƒuƒ‹\‘¢ƒŠƒXƒgˆê——</TITLE>
</HEAD>
<BODY>
<CENTER>
<P>ƒe[ƒuƒ‹\‘¢ƒŠƒXƒgˆê——</P>
</CENTER>
<%
  String drv = "oracle.jdbc.OracleDriver";
  String dsn = "jdbc:oracle:thin:@localhost:1521:sak";
  String sql = "select lower(table_name) as ƒe[ƒuƒ‹–¼, column_name as €–Ú–¼, lower(data_type) as €–Úƒ^ƒCƒv, nvl(data_precision, char_col_decl_length) as ’·‚³, data_scale as ¬”•” from user_tab_columns order by table_name, column_id";
  Connection cn = null;
  Statement st = null;
  ResultSet rs = null;
  String svtbl = "";

  // Oracle9i JDBC ƒhƒ‰ƒCƒoƒ[ƒh
  try {
    Class.forName(drv);
  } catch (Exception e) {
    out.println("<P>JDBC ƒhƒ‰ƒCƒoƒ[ƒhƒGƒ‰[<BR>" + e.toString() + "</P>");
  }

  // Oracle9i JDBC Ú‘±
  try {
    cn = DriverManager.getConnection(dsn, "sak", "sak");
  } catch (Exception e) {
    out.println("<P>JDBC Ú‘±ƒGƒ‰[<BR>" + e.toString() + "</P>");
  }

  // Oracle9i JDBC –â‚¢‡‚킹 SQL ì¬
  try {
    st = cn.createStatement();
  } catch (Exception e) {
    out.println("<P>JDBC –â‚¢‡‚킹 SQL 쬃Gƒ‰[<BR>" + e.toString() + "</P>");
  }

  // Oracle9i JDBC ƒŒƒR[ƒhƒZƒbƒgƒI[ƒvƒ“
  try {
    rs = st.executeQuery(sql);
  } catch (Exception e) {
    out.println("<P>JDBC ƒŒƒR[ƒhƒZƒbƒgƒI[ƒvƒ“ƒGƒ‰[<BR>" + e.toString() + "</P>");
  }

  // ƒe[ƒuƒ‹ƒwƒbƒho—Í
  out.println("<TABLE border=1 bordercolordark=White bordercolorlight=#bdaa90 cellPadding=4 cellSpacing=0>");
  out.println("<TBODY bgcolor=#f0f0f0>");

  // Oracle9i JDBC ƒŒƒR[ƒhƒZƒbƒgƒŠ[ƒh
  try {
    while (rs.next()) {
      if (!svtbl.equals(rs.getString("ƒe[ƒuƒ‹–¼"))) {
        if (!svtbl.equals("")) {
          out.println("<TR><TD colspan=4>@</TD></TR>");
        }
        svtbl = rs.getString("ƒe[ƒuƒ‹–¼");
        out.println("<TR bgcolor=#d0d0d0><TD>ƒe[ƒuƒ‹</TD><TD colspan=3>" + rs.getString("ƒe[ƒuƒ‹–¼") + "</TD></TR>");
        out.println("<TR bgcolor=#d0d0d0><TD>€–Ú</TD><TD>ƒ^ƒCƒv</TD><TD>’·‚³</TD><TD>¬”•”</TD></TR>");
      }
      out.println("<TR>");
      out.println("<TD>" + rs.getString("€–Ú–¼") + "</TD>");
      out.println("<TD>" + rs.getString("€–Úƒ^ƒCƒv") + "</TD>");
      out.println("<TD align=right>" + rs.getString("’·‚³") + "</TD>");
      out.println("<TD align=right>" + rs.getString("¬”•”") + "</TD>");
      out.println("</TR>");
    }
  } catch (Exception e) {
    out.println("<P>JDBC ƒŒƒR[ƒhƒZƒbƒgƒŠ[ƒhƒGƒ‰[<BR>" + e.toString() + "</P>");
  }

  // ƒe[ƒuƒ‹ƒeƒCƒ‹o—Í
  out.println("</TBODY></TABLE>");

  // Oracle9i JDBC ƒŒƒR[ƒhƒZƒbƒgƒNƒ[ƒY
  try {
    rs.close();
  } catch (Exception e) {}

  // Oracle9i JDBC ƒXƒe[ƒgƒƒ“ƒgƒNƒ[ƒY
  try {
    st.close();
  } catch (Exception e) {}

  // Oracle9i JDBC Ú‘±ƒNƒ[ƒY
  try {
    cn.close();
  } catch (Exception e) {}
%>
</BODY>
</HTML>

¡ŽÀsŒ‹‰Ê

ƒe[ƒuƒ‹\‘¢ƒŠƒXƒgˆê——

ƒe[ƒuƒ‹ipm
€–Úƒ^ƒCƒv’·‚³¬”•”
IP varchar2 15 null
‘gD1 varchar2 200 null
‘gD2 varchar2 200 null
@
ƒe[ƒuƒ‹logm
€–Úƒ^ƒCƒv’·‚³¬”•”
“ú•t char 10 null
ŽžŠÔ char 8 null
”Ô† number 9 0
Ž}”Ô number 3 0
Ž–‹ÆŠ char 2 null
’S“–ŽÒ varchar2 20 null
Žæˆø‹æ•ª varchar2 8 null
XV‘O”Ô† number 9 0
‘—MÏ char 1 null
SQL long 0 null
IP varchar2 15 null
USERNAME varchar2 20 null
@

¡JAVA ServletAJSP + Oracle9i •ÒŽ‘—¿
¡JAVA ServletAJSP + PostgreSQL •ÒŽ‘—¿
¡JAVA ServletAJSP Šî‘b•ÒŽ‘—¿
¡PostgreSQL •ÒAJAVA ServletAJSP •ÒŽ‘—¿
¡MySQL •ÒŽ‘—¿
¡SQL Šî‘b•ÒŽ‘—¿
¡SQL Šî‘bŽÀ’n•ÒŽ‘—¿
¡SQL ƒ`ƒ…[ƒjƒ“ƒO•ÒŽ‘—¿
¡Oracle PL/SQL •ÒŽ‘—¿
| VB | SQL | Perl | PHP | ASP | JSP | C | PC | HP | FAQ | ƒtƒŠ[ƒ\ƒtƒg |

SAK Streets ƒƒCƒ“ƒXƒgƒŠ[ƒg }‘ŠÙEƒJƒtƒF ˆê—— SAK Streets ŒŸõ



Copyright (C) 1999-2024 Y.SAK