import java.sql.*; import java.lang.*; class testDB { public static void main (String[] args) { Connection db; System.out.println("SQL Test"); try { Class.forName("org.postgresql.Driver"); } catch (ClassNotFoundException cnfe) { System.out.println(cnfe.toString()); System.exit(1); } try { db =DriverManager.getConnection("jdbc:postgresql:tester","b3",""); Statement st = db.createStatement(); ResultSet r = st.executeQuery("select * from passwd;"); while(r.next()){ for(int i = 1; i <= 2; i++){ System.out.println(r.getString(i) + "\t"); } System.out.println(); } } catch (SQLException e) { System.out.println(e.toString()); } } }
空白 |   |
< | < |
> | > |
& | & |
" | " |
<form > と</form> で囲む記述で以下に例を示す。 フォーム<form name="abc" action="exe.cgi" method=get> 一行入力フィールド<input type="text" name="txt1" size="10" value="123"> パスワード<input type="password" name="txt2" size="10" value="123"> テキスト入力欄<textarea name=txt3 rows=2 cols=40 wrap=soft>abc 123</textarea> 選択ボタン<input type="radio" name="rb" value=1 checked>1 <input type="radio" name="rb" value=2>2<br> チェックボタン<input type="checkbox" name="chk1" value=1 checked>1 <input type="checkbox" name="chk2" value=2>2<br> 選択メニュー<select name=sel1> <option value=1 selected>data1 <option value=2>data2 </select><br> <input type="submit" name="btn" value="提出する"><br> </form>
exe.cgi?txt1=123&txt2=123&txt3=abc+123&rb=1&chk1=1&sel1=1&btn=%92%F1%8Fo%82%B7%82%E9
GET |
PUT |
HEAD |
DELETE |
POST |
TRACE |
OPTION |
CONNETC |
text/html |
text/plain |
image/gif |
application/octet-stream |