untitled
|
|
|
- 谚 秘
- 9 years ago
- Views:
Transcription
1 Java
2 JDBC JAVA JAVA JDBC JDBC JDVA
3 1 Java Java Java Java Java Java JDK JDK JDK Java Java Java Java Java Java Java Java Java Java Java SQL SQL SQL... 46
4 VI 4.3 SQL SQL JDBC JDBC Java SQL JDBC ODBC API JDBC JDBC JDBC JDBC JDBC JDBC JDBC Statement ResultSet JDBC JDBC PreparedStatement PreparedStatement PreparedStatement CallableStatement CallableStatement CallableStatement JDBC JDBC JDBC
5 VII Servlet Servlet Servlet Servlet Servlet Servlet Servlet Web Servlet Web Servlet Servlet Servlet Servlet Servlet Servlet PreparedStatement Servlet CallableStatement Servlet Java Server Pages JSP JSP JSP JSP JSP JDBC JDBC API
6 VIII 14.1 Class DriverManager Interface Driver Class DriverPropertyInfo Interface Connection Interface PreparedStatement Interface ResultSet
7 1 Java 1.1 Java 1 Java Java Java Sun WWW WWW Java Java Internet PC Sun Java 1991 Sun Green World Wide Web James Gosling Sun Microsystem IBM SunNeWs C EMACS COSMACS Gosling CPU RISC Java Gosling C Gosling C ?Gosling Oak Java Oak Sun Java Gosling Java Gosling Virtual Machine Code Java Java Gosling SunNeWs NeWs Postscript Postscript Patrick Naughton Sun Open Windows
8 2 Java Naughton 17 Java Sun 75 Sun Java Sun ScottMcNealy BillJoy Java 3 Java IT 1994 WWW Gosling WWW Gosling Java Web Naughton JonathanPayne 1994 WebRunner WebRunner HotJava Java WebRunner HotJava Java Java Java Java Sun Internet Wintel Internet Java Java (1) Java IBM, Apple, DEC, Adobe, SiliconGraphics,HP,Oracel,Toshiba Microsoft Java (2) Java Borland Java Latte Borland Java PC Sun Java JavaWorkshop Illustra,Sysbase,Versant,Oracle CGI HTML Java HTML Java (3) Intranet Java Intranet Internet Intrnet Web ( Java Applet) WWW Java Sun JDK(JavaDevelopKit) JWS(JavaWorkshop) Java Java Java C++
9 1 Java Java Java Java 1 Java Java (1) Java C++ C++ Java C C++ C++ Java (2) Java C++ (3) Java 2 Java Java C Java Java SmallTalk SmallTalk 3 Java HTTP FTP TCP/IP Java URL Internet Java 4 Java Java Java Java Java Null 5 Java Java Java Java Solaris2.4(SPARC),Win32 (Windows95 WindowsNT) Java byte-code 6 Java Java C++ Java Java
10 4 Java 7 byte-code 8 ClassLoader build-in( ) 9 Java Java Java Windows3.1 (Integer) 16bits Windows95 32bits DECAlpha 64bits Intel486 32bits Java Java byte8-bit short16-bit int32-bit long64-bit float32-bitieee754 double32-bitieee754 char16-bitunicode Java CPU 8 64 / Java Java Java POSIX ANSIC Java 10 Java ( ) 11 Java Sun 30 C/C++ 12 Java Java C C++ (UNIX,Windows,Macintosh ) Java HTML 13 Java C++ C++
11 1 Java 5 Java Java Java Java Java 1.4 Java Java 1 JavaApplet Internet Java Java Applet,Java Java Java Java Javaapplet, WWW HTML, applet Web, Java Internet Applet, Applet Javaapplet Java,, (UI) Java Applet,,, applet : Applet Applet Applet Unix, Applet,, DLL Java Applet Java Java GUI C/C++ Hello World 1.2
12 6 Java 1.1 Java Applet 1.2 Java GUI 1.3~ Java Serverlet Java Servlet Servlet
13 1 Java Metal GUI 1.4 Motiff GUI 1.5 Windows GUI
14 8 Java JSP ASP ASP ASP ASP HTML CGI ASP (1) Windows Unix Windows NT ASP (2) Java JSP ASP Java Beans Java Web JSP JSP 1.8 JSP
15 1 Java Jsp Java Java Java Java 2 Java Java C++ C++ 3 C/C++ Java Java Java C/C++ 4 Java Java C/C++ Java 5 Java Java Java Unix Solaries AIX
16 2 Java 2.1 JDK Java JDK Java JDK Java JDK Java JavaAPI Java JavaAPI I/O JavaAPI I/O Java I/O Java JDK : Javac Java Java Java Java Java Appletviewer HTML Java Java Javadoc Java HTML Jdb Java Javah Java C Java C Javap Java 2.2 JDK JDK 2.1 JDK, JDK, Next 2.2 JDK Next 2.3 C: jdk1.3.0_01 Browse Next 2.4 JDK
17 2 Java 11 (1) Programe Files JDK java.exe Javac.exe Javasoc.exe 2.2 (2) Native Interface Header Files Java (3) Old Native Interface Header Files JDK
18 12 Java Java (4) Demos JDK Java (5) Java Source Java Next JDK
19 2 Java JDK JDK JDK JDK DOS Autoexec.bat set path=c:\jdk1.3.0_01\bin c:\jdk1.3.0_01 Path Java.exe command.com c:\jdk1.3.0_01\bin java.exe DOS set path=c:\jdk1.3.0_01\bin Autoexec.bat JDK Java JDK Sun Javasoft
20 14 Java 2 JDK JDK CLASS_PATH BIN JDK 3 4 java Applet AppletView 5 JDK JDK Sun
21 3 Java 3.1 HelloWorld Java HelloWorld Java publicclasshelloworld /**ThisroutineiscalledfirstbytheJavainterpreter. Itprintsamessagetotheconsole.*/ publicstaticvoidmain(string[]argv) /*javadocwillignorethiscomment*/ System.out.println("HelloWorld"); Hello World C/C++ Java main() Java main publicstatic
22 16 Java Java JavaApplication Java Main String C/C++ Java String C/C++ out java.lang.system println println Java 3.2 Java 1 Java : integer( ),floating( ),point( ),Boolean( ),CharacterorString( ) integer X86 8bitsbyte 16bitsshort 32bitsint 64bitslong floating E15 3e8 32bitsfloat 64bitsdouble Boolean true false Character a B X String Java 2 chars[]; int[]array; intblock[][]=newint[2][3], Java,, length inta[][]=newint[10][3]a.length/*10*/a[0].length/*3 Java (1) intlist[]=newint[50]; (2) Stringnames[]="Java","Database","Major","Application"; :
23 3 Java 17 String names[]; names=new String[4]; names[0]=new String("Chenji"); names[1]=new String("Yuan"); names[2]=new String("Chun"); names[3]=new String("Yang"); intname[50];// new intname[];for(inti=0;i<9;i++)name[i]=i; 3.3 Java Java C++, 1 // switch (i) case 0: // divided by zero int zero = 0; k = 911 / zero; break; case 1: // array index out of bound int[] c = new int[2]; k = c[9]; break; 2 /* */ /** TestDrive -- A test file for demonstration of the JDK. */ public class TestDrive /** This routine is called first by the Java interpreter. It prints a message to the console. */ public static void main(string[] argv) /* javadoc will ignore this comment */ System.out.println("JDK Test Drive"); 3 Javadoc Java Javadoc
24 18 /** * Applet * 3.0 */ class HiApplet extends Applet /** *@this method takes two parameters *@param key is the name of the symbol to store *@parameter value is what to store associated with this key */ void put(string key,object value) 3.4 Java Java, _,$,, C/C++ abc m_nfalg _ahd221 Java abstract continue for new switch boolean default goto null synchronized break do if package this byte double implements private threadsafe byvalue else import protected throw case extends instanceof public transient catch false int return true char final interface short try class finally long static void const float native super while cast future generic inner operator outer rest var 3.5 Java Java C/C++ 3-1
25 3 Java Java 3.6 Java Java C/C++, 3-2~ Java + += - -= * *= / /= % %= Java ~ &= & = ^= ^ >>= >> >>> 0 >>>= 0 << <<= 3-4 ==!= > < >= <=
26 20 Java 3-5 & &= = ^ ^= == &&!=!?: If then else 3-6 A B A False False False False False True True False True False True False False True True False True True True true true true False False. [ ] () ++ --! * / % + - << >> >>> < > <= >\ ==! = & ^ &&? : = op =, Java instanceof if (myobject instanceof MyClass)MyClass anothermyobject=(myclass) myobject; myobject MyClass class BasicMath public static void main(string args[]) int a=1+1; int b=a*3; int c=b/4; int d=b-a; int e=-d; System.out.println( ); System.out.println( a= +a); System.out.println( b= +b); System.out.println( c= +c); System.out.println( d= +d);
27 3 Java 21 System.out.println("e="+e); a+=5; b*=4; c+=a*b; c%=6; System.out.println("a+="+a); System.out.println("b*="+b); System.out.println("c%="+c); c=++b; d=a++; System.out.println("c="+c); System.out.println("d="+d); BasicMath.java : class Bit public static void main(string args[]) String binary[] = "0000","0001","0010","0011","0100","0101", "0110","0111","1000","1001","1010","1011",
28 22 Java "1100,1101,1110,1111", ; int a=3; //0011 in binary int b=6; //0110 in binary int c=a b; int d=a&b; int e=a^b; int f=(~a & b) (a&~b); int g=~a & 0x0f; System.out.println(" a=" + binary[a]); System.out.println(" b=" + binary[b]); System.out.println(" c=" +binary[c]); System.out.println(" d=" +binary[d]); System.out.println(" e=" +binary[e]); System.out.println(" f=" + binary[f]); System.out.println(" g=" + binary[g]); Bit.java (1) (2) Java.exe.class B00l
29 3 Java Java Java C/C++ 1 (1) if/else if (Boolean) statemanets; else statements; (2) switch switch(expr1) case expr2: statements; break; case expr3: statements; break; default: statements; break; 2 (1) for for (init expr1;test expr2;increment expr3) statements; (2) While While(Boolean)
30 24 Java statements; (3) Do do statements; while (Boolean); 3 break [label] ; continue [label] ; reutrn expr; label:statement; express statements Label class FinallyTest public static void main(string[] args) outer_loop: for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) try System.out.println("try before if: i=" + i + ", j=" + j); if ((i == 0) && (j == 1)) continue; else if ((i == 0) && (j == 2)) continue outer_loop; else if ((i == 1) && (j == 0)) break; else if ((i == 2) && (j == 1)) break outer_loop; System.out.println("try after if: i=" + i + ", j=" + j); finally System.out.println("finally: i=" + i + ", j=" + j
31 3 Java 25 + "\n"); switch : public class Fenshu public static void main(stringargs[]) System.out.println("\n**firstsituation**"); Char fenshu='c';//normaluse switch(fenshu) case'a': System.out.println(fenshu+"is85 100"); break; case'b': System.out.println(fenshu +"is70 84"); break; case'c': System.out.println(fenshu +"is60 69"); break;
32 26 Java case'd': System.out.println(fenshu +"is 60"); break; default: System.out.println("inputerror"); System.out.println("\n**secondsituation**"); fenshu ='A'; createrrorwithoutbreakstatement switch(fenshu) case'a': System.out.println(fenshu +"is85 100"); case'b': System.out.println(fenshu +"is70 84"); case'c': System.out.println(fenshu +"is60 69"); case'd': System.out.println(fenshu +"is 60"); default: System.out.println("inputerror"); System.out.println("\n**thirdsituation**"); fenshu ='B'; severalcasewithsameoperation switch(fenshu) case'a': case'b': case'c': System.out.println(grade+"is =60"); break; case'd': System.out.println(fenshu +"is 60"); break; break; default: System.out.println("inputerror"); 3.5
33 3 Java switch 3.8 Java,,, 1 1 : type arrayname[]; (type) Java, int,char,byte (class ), arrayname,[] : int Array[];, C C++,Java, [],,, new, : arrayname=new type[arraysize];,arraysize : int Array=new int[3]; 3 int,, : type arrayname=new type[arraysize]; : int Array=new int[3];
34 28 Java 2, new, : arrayname[index] index, a[3],b[i](i ),c[6*i] C/C++ 0 Java 0, 1 intarray, 3, int Array[0],int Array[1],int Array[2] : int Array[3], C C++,Java, length, :intarray.length intarray public class ArrayTest public static void main(stringargs[]) int i; int a[]=new int[5]; for(i=0;i 5;i++) a[i]=i; for(i=a.length-1;i =0;i--) System.out.println("a["+i+"]="+a[i]);
35 3 Java 29 3 int a[]=1,2,3,4,5; int a[3]; a[0]=1; a[1]=2; a[2]=3; 2 Java C/C++ 1 : type arrayname[arraysize1][arraysize2][arraysize3] ; : int Array[][];,, new,, :, : int a[][]=new int[2][3];,, : int a[][]=new int[2][]; a[0]=new int[3]; a[1]=new int[3]; (2), :arrayname[index1][index2] index1 index2,, a[2][3], 0 (3) int a[][]=2,3,1,5,3,4; 3 2,
36 30 Java public class MatrixMultiply public static void main(string args[]) inti,j,k; int a[][]=new int[2][3]; int b[][]=1,5,2,8,5,9,10,-3,2,7,-5,-18; int c[][]=new int[2][4]; for(i=0;i 2;i++) for(j=0;j 3;j++) a[i][j]=(i+1)*(j+2); for(i=0;i 2;i++) for(j=0;j 4;j++) c[i][j]=0; for(k=0;k 3;k++) c[i][j]+=a[i][k]*b[k][j]; System.out.println("\n***MatrixA***"); for(i=0;i 2;i++) for(j=0;j 3;j++) System.out.print(a[i][j]+""); System.out.println(); System.out.println("\n***MatrixB***"); for(i=0;i 3;i++) for(j=0;j 4;j++) System.out.print(b[i][j]+""); System.out.println(); System.out.println("\n***MatrixC***"); for(i=0;i 2;i++) for(j=0;j 4;j++) System.out.print(c[i][j]+""); System.out.println(); 3.7
37 3 Java Java Java Java Java class classname extends superclassname type instance-variable1; type instance-variable2;... type instance-variablen; type methodname1(parameter-list) method-body; type methodname2(parameter-list) method-body;... type methodnamen(parameter-list)
38 32 Java method-body; classname SuperClassname Extends public Private Private protected Private Private Protected Public Y Y Y Y N Y Y Y N Y N Y N N N Y N N N Y class PointTest public static void main(string[] args) MyPoint mp = new MyPoint(4,3); Point p = new Point(11); Point q = mp; mp.x = 5; mp.y = 12; System.out.println("\n\tData Member Access Test:\n"); System.out.println("mp = (" + mp.x + ", " + mp.y + ")"); System.out.println(" p = (" + p.x + ", " + p.y + ")"); System.out.println(" q = (" + q.x + ", " + q.y + ")"); System.out.println("\n\tCasting Test:\n"); System.out.println("(Point) mp = (" + ((Point) mp).x + ", " + ((Point) mp).y + ")"); System.out.println("(MyPoint) q = (" + ((MyPoint) q).x + ", " + ((MyPoint) q).y + ")"); System.out.println("\n\tMethod Member Access Test:\n"); System.out.println("mp.length() = " + mp.length());
39 3 Java 33 System.out.println(" p.length() = " + p.length()); System.out.println(" q.length() = " + q.length()); System.out.println("mp.distance() = " + mp.distance()); System.out.println("\n\tCasting Test:\n"); System.out.println("((Point) mp).length() = "+((Point)mp).length()); System.out.println("((Point) q).length() = "+((Point) q).length()); System.out.println("((MyPoint) q.distance() = " + ((MyPoint)q).distance( )); class Point int x; int y; Point(int x, int y) this.x = x; this.y = y; Point(int x) this(x, 0); Point() this(0, 0); double length() return Math.sqrt(x * x + y * y); class MyPoint extends Point int x; int y; MyPoint(int x, int y) this.x = super.x = x; this.y = super.y = y; double length() return Math.sqrt(x * x + y * y); double distance() return Math.abs(length() - super.length());
40 34 Java This Java this this Super,,, Java super Java,this, this,super super : (1), : super.variable (2), : super.method([paramlist]); (3), : super([paramlist]); super, class superclass
41 3 Java 35 int x; superclass() x=3; System.out.println("insuperClass:x="+x); void dosomething() System.out.println("insuperClass.doSomething()"); class subclass extends superclass int x; subclass() super(); x=5; System.out.println("insubClass:x="+x); void dosomething() super.dosomething(); System.out.println("insubClass.doSomething()"); System.out.println("super.x="+super.x+"sub.x="+x); public class inheritance public static void main(string args[]) subclass subc=new subclass(); subc.dosomething(); 3.9 Java Java Java
42 36 Java Java errno errno?reg; C goto Java Java Exception Exception Java 5 try,catch,throw,throws finally try finally try statements catch(exceptiontype1) error handle statements catch(exceptiontype2e)
43 3 Java 37 error handle throw(e); finally finally handler class ExceptionTest public static void main(string[] args) for (int i = 0; i < 4; i++) int k; try switch (i) case 0: // divided by zero int zero = 0; k = 911 / zero; break; case 1: // null pointer int[] b = null; k = b[0]; break; case 2: // array index out of bound int[] c = new int[2]; k = c[9]; break; case 3: // string index out of bound char ch = "abc".charat(99); break; catch (Exception e) System.out.println("\nTest case #" + i + "\n");
44 38 Java System.out.println(e); Java Windows 1 Windows 2 Java Java Java Java
45 3 Java 39 Macintosh MS-DOS Java Java Java Java Thread.currentThread class Deposit static int balance = 1000; // simulate the balance kept remotely public static void main(string[] args) Account account = new Account(); DepositThread first, second; first = new DepositThread(account, 1000, "#1"); second = new DepositThread(account, 1000, "\t\t\t\t#2"); // start the transactions first.start(); second.start(); // wait for both transactions to finish try first.join(); second.join(); catch (InterruptedException e) // print out the final balance System.out.println("*** Final balance is " + balance); class Account
46 40 Java void deposit(int amount, String name) int balance; System.out.println(name + " trying to deposit " + amount); System.out.println(name + " getting balance..."); balance = getbalance(); System.out.println(name + " balance got is " + balance); balance += amount; System.out.println(name + " setting balance..."); setbalance(balance); System.out.println(name + " new balance set to " + Deposit.balance); int getbalance() try // simulate the delay in getting balance remotely Thread.sleep(5000); catch (InterruptedException e) return Deposit.balance; void setbalance(int balance) try // simulate the delay in setting new balance remotely Thread.sleep(5000); catch (InterruptedException e) Deposit.balance = balance; class DepositThread extends Thread Account account; int deposit_amount; String message; DepositThread(Account account, int amount, String message) this.message = message; this.account = account; this.deposit_amount = amount;
47 3 Java 41 public void run() account.deposit(deposit_amount, message); : Thread DepositThread run, run Account deposit sleep 3.11~
48 42 Java 3.13 Java Java Java Java Main public static 2 Java syncronize 3 4 Java C++ C Java 5 Java Java Java, _,$,,
49 IBM E.F.Codd SQL Server IBM DB2 ORACLE SYBASE Informix E.F.Codd table 1.1 E.F.Codd E.F.Codd
50 44 Java RDBMS RDBMS DB MS R DBMS Web company ad hit company hit Pickles 7 14 (1) company Pickles, Inc 14 (2) ad (3) ad hit C.J.Date E.F.Codd 1 key
51 4 45 primary key PK NULL foreign key FK R S KS common key S parent table R child table S R 1:N (1) (2) (3) F K P K SQL SQL
52 46 Java IBM SQL Server 7 SQL ANSI-92 SQL SQL Server 7 SQL Server 7 SQL SQL Transact-SQL SQL Server SQL SQL SQL JDBC SQL SQL JDBC SQL sequel S Q L SQL sequel SQL SQL 1974 Boyce Chamberlin SEQUEL 1976 IBM San Jose System R SEQUEL2 SQL 1986 ANSI SQL SQL SQL SQL SQL Server 7.0 pubs SQL SQL Server SQL SELECT FROM WHERE SELECT < > FROM < > WHERE < >
53 4 47 SELECT FROM WHERE SQL SELECT SQL SELECT ANSI SQL SELECT select_list [ INTO new_table_] FROM table_source [WHERE search_condition] [GROUP BY group_by_expression] [ HAVING search_condition] [ORDER BY order_expression [ASC DESC] ] 1 SELECT * FROM TABLE _ NAME SELECT* FROM AUTHORS Select 2 SELECT COLUMN_NAME[,...n] FROM TABLE _ NAME
54 48 Java SELECT au_id,au_fname,au_lname FROM AUTHORS 4.2 ID 4.2 SELECT SELECT AU_FNAME,AU_LNAME,AU_ID FROM AUTHORS 3 SELECT COLUMN_NAME 'STRING LITERAL'[,...n] FROM TABLE _ NAME SELECT AU_FNAME,AU_LNAME,' ', A U _ I D FROM AUTHORS 4.3 Au_Id 4 SQL 1 = SELECT COLUMN_HEADING=COLUMN_NAME[... n ] FROM TABLE_NAME 2 SELECT COLUMN_NAME COLUMN_HEADING[... n ] FROM TABLE_NAME f i r s t n a m e l a
55 4 49 s t n a m e SELECT ' ' = AU_FNAME, ' ' = AU_LNAME, ' ' = AU_ID FROM AUTHORS 4.4 SQL SQL 1 0 % SELECT (PRICE*1.1),TITLE FROM TITLES %
56 50 Java SQL ASIN(float_expression) float_expression ACOS(float_expression) float_expression ATAN(float_expression) float_expression ATN2(float_expression) float_expression1,float_expression2 SIN(float_expression) float_expression COS(float_expression) float_expression TAN(float_expression) float_expression COT(float_expression) float_expression DEGREES(numeric_expression) RADIANS(numeric_expression) EXP((float_expression)) float_expression POWER(numeric_expression,y) numeric_expression y SORT(float_expression) float_expression SQUARE(float_expression) float_expression LOG(float_expression) float_expression LOG10(float_expression) float_expression 10 ABS(numeric_expression) numeric_expression CEILING(numeric_expression) numeric_expression FLOOR(numeric_expression) numeric_expression RAND([seed]) 0 1 seed PI()
57 4 51 ROUND(numeric_expression,length[,function]) numeric_expression numeric_expression length numeric_expression tinyint smallint int length numeric_expression length numeric_expression function ROUND tinyint smallint int 0 ROUND SIGN(numeric_expression) numeric_expression SELECT TITLE_ID,ROUND(PRICE*ROYALTY/100,0) FROM TITLES 4.6 DBMS SQL Server 4.6 Round 7 WHERE WHERE SELECT SELECT_LIST FROM TABLE_LIST WHERE SEARCH_CONDITIONS = > = = = BETWEEN NOT BETWEEN
58 52 Java IN NOT IN LIKE NOT LIKE IS NULL IS NOT NULL AND OR NOT NOT, 8000 SELECT au_lname,au_fname,phone FROM AUTHORS WHERE ZIP>'8000' BETWEEN 1 / 1 / / 3 1 / SELECT TITLE,PUBDATE FROM TITLES WHERE PUBDATE BETWEEN '1/1/91' AND '12/31/91' 4.8 IN MOD_COOK TRAD_COOK SELECT TITLE,TYPE FROM TITLES WHERE TYPE IN ('MOD_COOK','TRAD_COOK') 4.9 LIKE BOOK SELECT * FROM STORES WHERE STOR_NAME LIKE BOOK % 4.10
59 IN IS NULL SELECT TITLE FROM TITLES WHERE PRICE IS NULL 4.11 WHERE 3 AND OR NOT T
60 54 Java 4.10 Like 4.11 Is NUll DISTINCT SELECT DISTINCT CITY, STATE FROM AUTHORS 4.13 ORDER BY ORDER BY 4.14
61 Distinct ANSI SQL AVG COUNT MAX MIN SUM DBMS ANSI SQL
62 56 Java 4.14 Order By 1 select count(*) from titles (1 row(s) affected) 2 SELECT AVG(PRICE) FROM TITLES (1 row(s) affected) Warning: Null value eliminated from aggregate. 3 SELECT MAX (PRICE) FROM TITLES (1 row(s) affected) Warning: Null value eliminated from aggregate. 4 SELECT SUM(PRICE) FROM TITLES
63 4 57 (1 row(s) affected) Warning: Null value eliminated from aggregate. GROUP BY HAVING GROUP BY HAVING SELECT COLUMN_NAME[ C O L U M N _ N A M E ] FROM TA B L E _ N A M E WHERE SEARCH_CONDITION [GROUP BY [ALL] AGGREGATE_FREE_EXPRESSION [ AGGREGATE_FREE_EXPRESSION ] ] [ HAVING SEARCH_CONDITIONS] 1 SELECT TITLE_ID,COPIES_SOLD=SUM(QTY) FROM SALES GROUP BY TITLE_ID Group By GROUP BY GROUP BY HAVING SELECT TITLE_ID,COPIES_SOLD=SUM(QTY) FROM SALES GROUP BY TITLE_ID HAVING SUM(QTY)>
64 58 Java 4.16 Having 4.3 SQL SELECT COLUMN_NAME C O L U M N _ N A M E [,... n ] FROM TA B L E _ N A M E TA B L E _ N A M E [,... n ] WHERE TABLE_NAME.COLUMN_NAME JOIN_OPERATOR TABLE_NAME. C O L U M N _ N A M E J O I N _ O P E R ATO R = > < > = < =! = < >! >!< 1 SELECT P.PUB_NAME,T.TITLE FROM PUBLISHERS AS P,TITLES AS T 4.17 PUB_NAME PUBLISHERS 2
65 SELECT P.PUB_NAME,T.TITLE FROM TITLES AS T,PUBLISHERS AS P WHERE T.PUB_ID=T.PUB_ID
66 60 Java 3 SALES SELECT STOR_NAME, QTY, title FROM TITLES,STORES, SALES WHERE TITLES.TITLE_ID=SALES.TITLE_ID AND STORES. STOR_ID=SALES.STOR_ID SELECT A.TITLE_ID, A.AU_ID,B.AU_ID FROM TITLEAUTHOR AS A,TITLEAUTHOR AS B WHERE A.TITLE_ID=B.TITLE_ID AND A.AU_ID=B. AU_ID SELECT TITLES.TITLE_ID,TITLE,QTY FROM TITLES,SALES WHERE TITLES.TITLE_ID *= SALES.TITLE_ID
67 *= TITLE_ID QTY PC PS BU PS TC PS PS PS PS PS PC9999 NULL TC PS PC MC BU TC BU BU MC
68 62 Java MC MC3026 NULL BU (23 row(s) affected) 2 SELECT TITLES.TITLE_ID,QTY FROM TITLES,SALES WHERE TITLES.TITLE_ID = SALES.TITLE_ID TITLE_ID QTY BU PS PC PS PS TC TC TC PS MC PS PS PS PS BU MC BU MC BU BU PC (21 row(s) affected) 4.4 SELECT SELECT SELECT SELECT
69 SELECT TITLE=TITLE_ID, QUANTITY=QTY, TOTAL=(SELECT SUM(QTY) FROM SALES), PERCENTAGE_OF_TOTAL =(QTY)/(SELECT SUM(QTY)FROM SALES)*100) FROM SALES CONVERT 0 TITLE QUANTITY TOTAL PERCENTAGE_OF_TOTAL BU PS PC PS PS TC TC TC PS MC PS PS PS PS BU MC BU MC BU BU PC (21 row(s) affected) 2 IN
70 64 Java SELECT title_id,type,price FROM TITLES WHERE TITLE_ID IN (SELECT TITLE_ID FROM SALES) title_id type price BU1032 business BU1111 business BU2075 business BU7832 business MC2222 mod_cook MC3021 mod_cook PC1035 popular_comp PC8888 popular_comp PS1372 psychology PS2091 psychology PS2106 psychology PS3333 psychology PS7777 psychology TC3218 trad_cook TC4203 trad_cook TC7777 trad_cook (16 row(s) affected) 3 WHERE SELECT I D SELECT TITLE_ID,AU_ID,ROYALTYPER FROM TITLEAUTHOR AS TA WHERE ROYALTYPER= (SELECT MAX (ROYALTYPER) FROM TITLEAUTHOR WHERE TITLE_ID=TA.TITLE_ID) TITLE_ID AU_ID ROYALTYPER BU BU BU BU MC MC PC PC
71 4 65 PC PC PS PS PS PS PS PS TC TC TC (19 row(s) affected) 4 EXISTS EXISTS ( ) SELECT TITLE_ID,PRICE FROM TITLES WHERE EXISTS (SELECT * FROM SALES WHERE TITLES.TITLE_ID =SALES.TITLE_ID) TITLE_ID PRICE BU BU BU BU MC MC PC PC PS PS PS PS PS TC TC TC (16 row(s) affected) EXISTS EXISTS TRUE SELECT
72 66 Java 5 SELECT INTO SQL Server # #PER SELECT TITLE_ID,PRICE INTO #PER FROM TITLES WHERE EXISTS (SELECT * FROM SALES WHERE TITLES.TITLE_ID =SALES.TITLE_ID) Exists #PER SELECT TITLE_ID,PRICE FROM #PER TITLE_ID PRICE BU BU BU BU MC MC PC PC PS
73 4 67 PS PS PS PS TC TC TC (16 row(s) affected) 4.5 SQL SQL 1 INSERT [INTO] table_name WITH ( <table_hint_limited> [...n]) view_name rowset_function_limited [(column_list)] VALUES ( DEFAULT NULL expression [,...n] ) derived_table execute_statement DEFAULT VALUES <table_hint_limited> ::= INDEX(index_val [,...n]) FASTFIRSTROW HOLDLOCK PAGLOCK READCOMMITTED REPEATABLEREAD
74 68 Java ROWLOCK SERIALIZABLE TABLOCK TABLOCKX (1) (2) NOT NULL (3) TE CREATE TABLE #TE (BOOK_NAME CHAR(10),PRICE INT) INSERT #TE VALUES ('NKBOOK',197) INSERT TABLE_NAME SELECT COLUMN_LIST FROM TABLE_LIST WHERE SEARCH_CONDITIONS
75 4 69 TE INSERT #TE SELECT TITLE_ID,PRICE FROM TITLES (18 row(s) affected) TE SELECT * FROM #TE BOOK_NAME PRICE NKBOOK 197 BU BU BU BU MC MC MC3026 NULL PC PC PC9999 NULL PS PS PS PS PS TC TC TC (19 row(s) affected) INSERT SELECT 3 ANSI SQL UPDATE UPDATE table_name WITH ( <table_hint_limited> [...n]) view_name rowset_function_limited
76 70 Java SET column_name = expression DEFAULT = = column = expression [,...n] [FROM <table_source> [,...n] ] [WHERE <search_condition>] [WHERE CURRENT OF [GLOBAL] cursor_name cursor_variable_name ] [OPTION (<query_hint> [,...n] )] <table_source> ::= table_name [ [AS] table_alias ] [ WITH ( <table_hint> [,...n]) ] view_name [ [AS] table_alias ] rowset_function [ [AS] table_alias ] derived_table [AS] table_alias [ (column_alias [,...n] ) ] <joined_table> <joined_table> ::= <table_source> <join_type> <table_source> ON <search_condition> <table_source> CROSS JOIN <table_source> <joined_table> <join_type> ::= [ INNER LEFT RIGHT FULL [OUTER] ] [ <join_hint> ] JOIN <table_hint_limited> ::= INDEX(index_val [,...n]) FASTFIRSTROW HOLDLOCK PAGLOCK READCOMMITTED REPEATABLEREAD ROWLOCK
77 4 71 SERIALIZABLE TABLOCK TABLOCKX <table_hint> ::= INDEX(index_val [,...n]) FASTFIRSTROW HOLDLOCK NOLOCK PAGLOCK READCOMMITTED READPAST READUNCOMMITTED REPEATABLEREAD ROWLOCK SERIALIZABLE TABLOCK TABLOCKX UPDLOCK <query_hint> ::= HASH ORDER GROUP CONCAT HASH MERGE UNION LOOP MERGE HASH JOIN FAST number_rows FORCE ORDER MAXDOP ROBUST PLAN KEEP PLAN TE 1 UPDATE #TE SET PRICE=PRICE + 1 (19 row(s) affected) TE SELECT * FROM #TE
78 72 Java BOOK_NAME PRICE NKBOOK 198 BU BU BU BU MC MC MC3026 NULL PC PC PC9999 NULL PS PS PS PS PS TC TC TC (19 row(s) affected) #TE TITLES UPDATE #TE SET PRICE =(SELECT PRICE FROM TITLES WHERE #TE.BOOK_NAME=TITLES.TITLE_ID) (19 row(s) affected) #TE SELECT * FROM #TE BOOK_NAME PRICE NKBOOK NULL BU BU BU2075 3
79 4 73 BU MC MC MC3026 NULL PC PC PC9999 NULL PS PS PS PS PS TC TC TC (19 row(s) affected) TITLES 4 ANSI SQL DELETE [FROM ] table_name WITH ( <table_hint_limited> [...n]) view_name rowset_function_limited [ FROM <table_source> [,...n] ] [WHERE <search_condition> [ CURRENT OF [ GLOBAL ] cursor_name cursor_variable_name ] ]
80 74 Java [OPTION (<query_hint> [,...n])] <table_source> ::= table_name [ [AS] table_alias ] [ WITH ( <table_hint> [,...n]) ] view_name [ [AS] table_alias ] rowset_function [ [AS] table_alias ] derived_table [AS] table_alias [ (column_alias [,...n] ) ] <joined_table> <joined_table> ::= <table_source> <join_type> <table_source> ON <search_condition> <table_source> CROSS JOIN <table_source> <joined_table> <join_type> ::= [ INNER LEFT RIGHT FULL [OUTER] ] [ <join_hint> ] JOIN <table_hint_limited> ::= INDEX(index_val [,...n]) FASTFIRSTROW HOLDLOCK PAGLOCK READCOMMITTED REPEATABLEREAD ROWLOCK SERIALIZABLE TABLOCK TABLOCKX <table_hint> ::= INDEX(index_val [,...n]) FASTFIRSTROW HOLDLOCK NOLOCK PAGLOCK READCOMMITTED READPAST
81 4 75 READUNCOMMITTED REPEATABLEREAD ROWLOCK SERIALIZABLE TABLOCK TABLOCKX UPDLOCK <query_hint> ::= HASH ORDER GROUP CONCAT HASH MERGE UNION FAST number_rows FORCE ORDER MAXDOP ROBUST PLAN KEEP PLAN #PER 10 DELETE #PER WHERE PRICE<10 (4 row(s) affected) #PER SELECT * FROM #PER TITLE_ID PRICE BU BU BU MC PC PC PS PS PS TC TC
82 76 Java TC (12 row(s) affected) TITLES BUSINESS #TE DELETE #TE FROM #TE INNER JOIN TITLES ON #TE.BOOK_NAME=TITLES.TITLE_ID WHERE( TITLES.TYPE='BUSINESS') #TE SELECT * FROM #TE BOOK_NAME PRICE NKBOOK NULL MC MC MC3026 NULL PC PC PC9999 NULL PS PS PS PS PS TC
83 4 77 TC TC (15 row(s) affected) INNER JOIN *= 4.6 SQL (1) (2) (3) (4) 1 ANSI SQL CREATE PROC[EDURE] procedure_name [;number] data_type [VARYING] [= default] [OUTPUT] ] [,...n] [WITH RECOMPILE ENCRYPTION RECOMPILE, ENCRYPTION ] [FOR REPLICATION] AS sql_statement [...n] SQL
84 78 Java #TITLES CREATE PROCEDURE US_TITLES AS SELECT * FROM TITLES GO EXEC EXECUTE US_TITLES TITLES #TE IF OBJECT_ID('US_COM') IS NOT NULL DROP PROCEDURE US_COM GO CREATE PROCEDURE INT AS BEGIN PRINT " " RETURN END
85 BEGIN TRANSACTION INSERT #TE SELECT TITLE_ID,PRICE FROM TITLES WHERE COMMIT PRINT " " GO 4.26 EXEC US_COM 18 TITLES 18 #TE 4.26
86 80 Java BOOK_NAME PRICE BU BU MC PS PS PS TC TC (8 row(s) affected) 3 OUTPUT CREATE PROCEDURE INT,@PAR2 INT,@PAR3 INT OUTPUT AS GO The command(s) completed successfully. INT EXEC US_BOOL 10,10,@P OUTPUT GO DROP PROCEDURE US_BOOL DROP PROCEDURE US_BOOL The command(s) completed successfully. US_BOOL INT EXEC US_BOOL 10,10,@P OUTPUT GO
87 Server: Msg 2812, Level 16, State 62, Line Could not find stored procedure 'US_BOOL'
88 5 JDBC 5.1 JDBC JDBC SQL Java API JDBC JDBC Java (Java Database Connectivity) Java JDBC / API Java API JDBC SQL JDBC API Sybase Oracle Informix JDBC API SQL Java Java JDBC Java Java JDBC JDBC Java Java JDBC API applet applet JDBC Intranet Windows Macintosh UNIX Java Java MIS Java JDBC Java JDBC JDBC (1) (2) SQL (3) Connection con = DriverManager.getConnection ( "jdbc:odbc:wombat", "login", "password"); Statement stmt = con.createstatement();
89 5 JDBC 83 ResultSet rs = stmt.executequery("select a, b, c FROM Table1"); while (rs.next()) int x = rs.getint("a"); String s = rs.getstring("b"); float f = rs.getfloat("c"); JDBC API JDBC SQL API API API JDBC JDBC API (1) Java SQL DBMS SQL JDBC SQL String Java SQL SQL Java SQL Java SQL SQL JDBC Java/SQL Java (2) Java JavaSoft API / Java SQL Java JDBC JDBC SQL 5.2 Java JDBC API Java applet JDBC SQL / Intranet Internet SQL SQL MIS API C C++ Java Java
90 84 Java Java JDBC Java 5.3 SQL (SQL) DBMS SQL SQL SQL JDBC API SQL JDBC API DBMS SQL DBMS SQL DBMS SQL JDBC SQL ODBC SQL JDBC JDBC SQL DatabaseMetaData DBMS DBMS JDBC API API API JDBC TM JDBC ANSI SQL-2 Entry Level ANSI SQL Entry Level SQL JDBC API JDBC TM JDBC JavaSoft JDBC API SQL Entry Level JavaSoft JDBC Internet JDBC API JDBC Java 5.4 JDBC ODBC API Microsoft ODBC API Java ODBC JDBC JDBC-ODBC JDBC (1) ODBC Java C Java C (2) ODBC C API Java API Java ODBC void * JDBC
91 5 JDBC 85 ODBC Java (3) ODBC JDBC (4) Java JDBC Java API ODBC ODBC Java JDBC JDBC Java JDBC API SQL Java ODBC ODBC JDBC JDBC ODBC X/Open SQL CLI JDBC Java Microsoft ODBC API RDO ADO OLE DB JDBC ODBC ODBC ODBC ODBC JDBC / SQL API 5.5 JDBC JDBC URL 1 JavaSoft JavaSoft JDBC Java (JDK) JDBC JDBC JDBC-ODBC JDBC JDBC Java JDBC JDBC JDBC JDBC JDBC TM JDBC-ODBC ODBC JDBC JDBC DBMS DBMS JDBC 2 JDBC JDBC (1) JDBC-ODBC ODBC JavaSoft ODBC JDBC ODBC Java (2) API Java API
92 86 Java JDBC Oracle Sybase Informix DB2 DBMS (3) JDBC Java JDBC DBMS DBMS Java JDBC Intranet Internet Web JDBC (4) Java JDBC DBMS DBMS Intranet 3 4 JDBC 1 2 Java Java JDBC applet 5.6 JDBC 1 Applet Java applet web applet JDBC applet applet applet internet applet Internet applet Internet applet applet (1) applet (2) Internet applet (3) Internet applet 2 Application Java Java Java Java Java Intranet Intranet
93 5 JDBC 87 Java GUI Java Java Intranet applet Customers Personnel DBMS JDBC driver Java 3 Servlet SUN Web 4 (1) applet Trusted applets Java applet applet appliction applet (2) Java GUI / DBMS Java RPC (remote procedure call) ORB (object request broker ) MIS C C++ Java Java Java 5.7 JDBC Java JDBC Java applications Java trusted Java applet 1 JDBC applet JDBC Java JDBC applets JDBC applets JDBC DriverManager JDBC Driver applet JDBC applet IP applet
94 88 Java 2 JDBC Java Java Java applet JDBC applet sun.sql.driver 3 Driver JDBC driver applet applet Java applet TCP/IP JDBC TCP Java applet JDBC TCP Java JDBC TCP applet A foobah TCP applet B applet B foobah TCP JDBC SecurityManager security = System.getSecurityManager(); if (security!= null) security.checkconnect(hostname, portnumber); Security.checkConnect java.lang.security Exception 4 JDBC SecurityManager security = System.getSecurityManager(); if (security!= null) security.checkread(filename);
95 5 JDBC 89 Security.checkRead java.lang.securityexception 5 applet JDBC-ODBC ODBC applet applet JDBC SecurityManager security = System.getSecurityManager(); if (security!= null) security.checkwrite("foobaz"); 5.8 JDBC JDK JDBC JDK JDBC ODBC JDBC ODBC Windows JDBC 2 JDBC IT JDBC JDBC 3 JDBC 4 JDBC MS ADO JDBC ADO JDBC
96 6 JDBC JDBC JDBC 6.1 SQL Server 7.0 Windows 98 ODBC (1) SQL Server (2) 6.2 TEST LOCATION 6.3 (3) TEST NEW\TABLE 6.4 (4) USER (5) USER 6.5 (6)
97 6 JDBC (7) 6.7 (8) SQL Server SQL Server 6.8 (9) SQL Server 6.9 (10) 6.10 (11)
98 92 Java ODBC
99 6 JDBC
100 94 Java
101 6 JDBC 95 (12) 6.13 JDBC JDBC 1. JDBC DriverManager import java.net.url; import java.sql.*; class Test public static void main(string args[]) String l="jdbc:odbc:test"; try try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); catch(java.lang.classnotfoundexception e) System.err.print("ClassNotFoundException: ");
102 96 Java System.err.println(e.getMessage()); Connection con=drivermanager.getconnection(l,"nkwht",""); DatabaseMetaData dma=con.getmetadata(); System.out.println(" :" + dma.geturl()); System.out.println("Driver :"+ dma.getdrivername()); System.out.println("Version :" + dma.getdriverversion()); con.close(); catch(sqlexception ex) while(ex!=null) System.out.println(" "); System.out.println(ex.getSQLState()); System.out.println(ex.getMessage()); System.out.println(ex.getErrorCode()); ex=ex.getnextexception();
103 6 JDBC Class.forName sun.jdbc.odbc.jdbcodbcdriver Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); java.lang.system jdbc.drivers DriverManager DriverManager jdbc.drivers DriverManager ~/.hotjava/properties HotJava jdbc.drivers=foo.bah.driver:wombat.sql.driver:bad.test.ourdriver; DriverManager Class.forName DriverManager jdbc.drivers Driver DriverManager.registerDriver JDBC DriverManager 3. Driver DriverManager DriverManager.getConnection DriverManager JDBC URL JDBC-ODBC JDBC DriverManager URL DriverManager jdbc.drivers Driver.connect DriverManager.getConnection URL URL JDBC-ODBC Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); // String url = "jdbc:odbc:test ;
104 98 Java DriverManager.getConnection(url, "userid", "passwd"); Connection DriverManager getconnection() Connection Connection con=drivermanager.getconnection(); 4. DriverManager.getConnection URL DriverManager JDBC URL DriverManager Driver getconnection URL Driver connect URL JDBC Driver DriverManager URL "jdbc:odbc:wombat" oboy 12Java String url = "jdbc:odbc:wombat"; Connection con = DriverManager.getConnection(url, "oboy", "12Java"); 5. URL URL URL JDBC URL URL Internet URL ftp http file Internet URL ftp://javasoft.com/docs/jdk-1_apidocs.zip file:/home/haroldw/docs/books/tutorial/summary.html URL file URL ftp http URL JavaSoft URL URL JDBC JDBC URL 6. JDBC URL JDBC URL JDBC URL
105 6 JDBC 99 JDBC URL URL JDBC JDBC URL JDBC URL odbc URL JDBC URL applet JDBC URL JDBC URL JDBC DNS NIS DCE, JDBC URL jdbc:< >:< > JDBC URL Jdbc JDBC URL jdbc < > odbc ODBC URL JDBC-ODBC URL jdbc:odbc:test odbc TEST ODBC JDBC URL URL jdbc:dcenaming:accounts-payable URL DCE accounts-payable < > ODBC fred Internet JDBC URL URL // : / dbnet Internet JDBC URL jdbc:dbnet://wombat:356/test 7. ODBC odbc ODBC URL ODBC
106 100 Java jdbc:odbc:< >[;< >=< >]* jdbc:odbc jdbc:odbc:qeor7 jdbc:odbc:wombat jdbc:odbc:wombat;cachesize=20;extensioncase=lower jdbc:odbc:qeora;uid=kgh;pwd=fooey 8. TRY CATCH JDK 6.15 import java.net.url; import java.sql.*; class Test public static void main(string args[]) String l="jdbc:odbc:test"; Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=drivermanager.getconnection(l,"nkwht",""); DatabaseMetaData dma=con.getmetadata(); System.out.println(" :" + dma.geturl()); System.out.println("Driver :"+ dma.getdrivername()); System.out.println("Version :" + dma.getdriverversion()); con.close(); 6.15
107 6 JDBC , TRY CATCH JDK 2 String l="jdbc:odbc:test"; Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=drivermanager.getconnection(l,"nkwht",""); URL Connection 3 Connection void clearwarnings() void close() void commit() Statement createstatement() Statement createstatement(int resultsettype, int resultsetconcurrency) boolean getautocommit() String getcatalog() DatabaseMetaData getmetadata() int gettransactionisolation() Map gettypemap() SQLWarning getwarnings() boolean isclosed() boolean isreadonly() String nativesql(string sql) CallableStatement preparecall(string sql) CallableStatement preparecall(string sql, int resultsettype, int resultsetconcurrency) PreparedStatement preparestatement(string sql) PreparedStatement preparestatement(string sql, int resultsettype, int resultsetconcurrency) void rollback() void setautocommit(boolean autocommit) void setcatalog(string catalog) void setreadonly(boolean readonly) void settransactionisolation(int level) void settypemap(map map)
108 7 JDBC 7.1 JDBC SQL JDBC import java.net.url; import java.sql.*; class Select public static void main(string args[]) String l="jdbc:odbc:test"; try try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); catch(java.lang.classnotfoundexception e) System.err.print("ClassNotFoundException: "); System.err.println(e.getMessage()); Connection con=drivermanager.getconnection(l,"sa",""); Statement stmt = con.createstatement(); stmt.executeupdate( "INSERT INTO USERINFO " + "VALUES ('NKWHT',' ',' :03')"); con.close();
109 7 JDBC 103 catch(sqlexception ex) while(ex!=null) System.out.println(" "); System.out.println(ex.getSQLState()); System.out.println(ex.getMessage()); System.out.println(ex.getErrorCode()); ex=ex.getnextexception(); SQL Server SQL : SELECT * FROM USERINFO Class.forName Connection Statement Statement
110 104 Java executeupdate SQL Statement Statement Statement SQL Statement SQL Statement PreparedStatement Statement CallableStatement PreparedStatement SQL Statement SQL PreparedStatement IN SQL CallableStatement Statement PreparedStatement IN CallableStatement OUT 1. Statement SQL Statement Connection createstatement Connection con = DriverManager.getConnection(url, "sunny", ""); Statement stmt = con.createstatement(); 2. Statement SQL Statement SQL Statement ResultSet rs = stmt.executequery("select a, b, c FROM Table2"); Statement SQL executequery executeupdate execute SQL executequery SELECT executeupdate INSERT UPDATE DELETE SQL DDL CREATE TABLE DROP TABLE INSERT UPDATE DELETE executeupdate CREATE TABLE DROP TABLE executeupdate execute Statement Statement ResultSet Statement PreparedStatement executequery executeupdate execute Statement SQL Statement.execute SQL PreparedStatement SQL SQL CallableStatement PreparedStatement PreparedStatement CallableStatement SQLException
111 7 JDBC executequery ResultSet executeupdate execute DBMS commit Statement Java Statement DBMS 4. Statement SQL Statement SQL SQL DBMS keyword... parameters... (1) escape LIKE % _ SQL LIKE % _ \ escape 'escape-character' stmt.executequery("select name FROM Identifiers WHERE Id LIKE `\_%' escape `\'; (2) fn DBMS fn concat fn concat("hot", "Java"); fn user(); DBMS DatabaseMetaData getnumericfunctions getstringfunctions
112 106 Java (3) d t ts DBMS JDBC ISO DBMS JDBC SQL d `yyyy-mm-dd' yyyy mm dd DBMS '28- FEB-99' d TIME TIMESTAMP t `hh:mm:ss' ts `yyyy-mm-dd hh:mm:ss.f...' TIMESTAMP.f... call JDBC call procedure_name[(?,?,...)] call procedure_name[(?,?,...)] JDK CallableStatement DatabaseMetaData.supportsStoredProcedures (4) oj oj outer-join outer-join table LEFT OUTER JOIN table / outer-join ON search-condition SQL JDBC DatabaseMetaData supportsouterjoins supportsfullouterjoins supportslimitedouterjoins Statement.setEscapeProcessing setescapeprocessing PreparedStatement PreparedStatement 7.2 SQL Server PUBS
113 7 JDBC 107 PUB SQL Server SQL Server DATABASE PUBS TABLES TITLE PROPERTIES PUBLIC JDBC
114 108 Java 7.4 Java import java.net.url; import java.sql.*; class Select public static void main(string args[]) String l="jdbc:odbc:pub"; try try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); catch(java.lang.classnotfoundexception e) System.err.print("ClassNotFoundException: "); System.err.println(e.getMessage()); Connection con=drivermanager.getconnection(l,"sa",""); Statement stmt = con.createstatement(); ResultSet rs=stmt.executequery("select * from TITLES"); while(rs.next())
115 7 JDBC 109 for(int i=1;i<11;i++) System.out.println(" " + i + " " + rs.getstring(i)); con.close(); catch(sqlexception ex) while(ex!=null) System.out.println(" "); System.out.println(ex.getSQLState()); System.out.println(ex.getMessage()); System.out.println(ex.getErrorCode()); ex=ex.getnextexception(); : 1 BU The Busy Executive's Database Guide 3 business An overview of available database systems withemphasis on common business applications. Illustrated :00: BU Cooking with Computers: Surreptitious Balance Sheets 3 business Helpful hints on how to use yourelectronic resources to the best
116 110 Java advantage :00: BU You Can Combat Computer Stress! 3 business The latest medical and psychological techniques for livingwith the electronic office. Easy-to-understand explanations :00: BU Straight Talk About Computers 3 business Annotated analysis of what computers can do for you: a no-hype guide for the critical user :00: MC Silicon Valley Gastronomic Treats 3 mod_cook Favorite recipes for quick, easy, and elegant meals :00: MC The Gourmet Microwave 3 mod_cook
117 7 JDBC Traditional French gourmet recipes adapted for modern microwave cooking :00: MC The Psychology of Computer Cooking 3 UNDECIDED null 6 null 7 null 8 null 9 null :10: PC But Is It User Friendly? 3 popular_comp A survey of software for the naive user, focusing on the'friendliness' of each :00: PC Secrets of Silicon Valley 3 popular_comp Muckraking reporting on the world's largest computerhardware and software manufacturers :00: PC Net Etiquette 3 popular_comp
118 112 Java null 6 null 7 null 8 null 9 A must-read for computer conferencing :10: PS Computer Phobic AND Non-Phobic Individuals: Behavior Variations 3 psychology A must for the specialist,this book examines the difference between those who hate and fear computers and those who don't :00: PS Is Anger the Enemy? 3 psychology Carefully researched study of the effects of strong emotions on the body. Metabolic charts included :00: PS Life Without Fear 3 psychology New exercise, meditation, and nutritional techniques that can reduce the shockof daily interactions. Popular audience. Sample menus included, exercise video
119 7 JDBC 113 available separately :00: PS Prolonged Data Deprivation: Four Case Studies 3 psychology What happens when the data runs dry?searching evaluations of information-shortage effects :00: PS Emotional Security: A New Algorithm 3 psychology Protecting yourself and your loved ones from undue emotional stress in the modern world. Use of computer and nutritional aids emphasized :00: TC Onions, Leeks, and Garlic: Cooking Secrets of the Mediterranean 3 trad_cook Profusely illustrated in color, this makes a wonderful gift book for a cuisine-oriented friend :00: TC Fifty Years in Buckingham Palace Kitchens 3 trad_cook
120 114 Java More anecdotes from the Queen's favorite cook describing life among English royalty. Recipes, techniques, tender vignettes :00: TC Sushi, Anyone? 3 trad_cook Detailed instructions on how to make authentic Japanese sushi in your spare time :00: ,, ResultSet JDBC getstring (1) (2) ResultSet 7.3 ResultSet 1 ResultSet SQL get get ResultSet.next ResultSet SELECT a, b, c FROM Table1 a b c Cupertino CA Redmond WA
121 7 JDBC Boston MA SQL SQL 1 int 2 String 3 java.sql.statement stmt = conn.createstatement(); ResultSet r = stmt.executequery("select a, b, c FROM Table1"); while (r.next()) // int i = r.getint("a"); String s = r.getstring("b"); float f = r.getfloat("c"); System.out.println("ROW = " + i + " " + s + " " + f); 2 ResultSet next next next ResultSet ResultSet Statement SQL getcursorname DBMS DatabaseMetaData.supportsPositionedDelete supportspositionedupdate DBMS/ 3 getxxx ResultSet rs title String s = rs.getstring("title"); String s = rs.getstring(2); 1 getxxx getxxx select select * from table1 SQL getxxx getxxx
122 116 Java ResultSet ResultSet.getMetaData ResultSetMetaData ResultSet findcolumn 4 getxxx JDBC Java Java getxxx getstring VARCHAR JDBC VARCHAR Java String getstring Java String getxxx JDBC JDBC SQL x getxxx X getxxx getbytes getbinarystream getxxx LONGVARCHAR getasciistream getunicodestream getobject Java Object ResultSet.getXXX JDBC 7-1 ResultSet 7-1 ResultSet GetByte GetShort getint GetLong GetFloat GetDouble GetBigDecimal GetBoolean GetString getbytes GetDate GetTime GetTimestamp GetAsciiStream GetUnicodeStream getbinarystream UNICODE getobject 5 ResultSet LONGVARBINARY LONGVARCHAR
123 7 JDBC 117 getbytes getstring Statement.getMaxFieldSize ResultSet java.io.input ResultSet getxxx JDBC API getbinarystream getasciistream ASCII getunicodestream Unicode Java ASCII Unicode getasciistream java.sql.statement stmt = con.createstatement(); ResultSet r = stmt.executequery("select x FROM Table2"); // 4KB 1 byte buff = new byte[4096]; while (r.next()) Java.io.InputStream fin = r.getasciistream(1); for (;;) int size = fin.read(buff); if (size == -1) // break; // ASCII output.write(buff, 0, size); 6 NULL JDBC NULL ResultSet.wasNull JDBC NULL ResultSet.getXXX JDBC NULL wasnull Java null Java getxxx getstring getbigdecimal getbytes getdate gettime gettimestamp getasciistream getunicodestream getbinarystream getobject getbyte getshort getint getlong getfloat getdouble false getboolean 7 executequery ResultSet executeupdate SQL
124 118 Java / JDBC execute getresultset getupdatecount getmoreresults ResultSet ResultSet Statement ResultSet Statement 7.4 JDBC JDBC 1 SQL Server PUBS TITLES import java.net.url; import java.sql.*; class Delete public void main(string args[]) String l="jdbc:odbc:pub"; try try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); catch(java.lang.classnotfoundexception e) System.err.print("ClassNotFoundException: "); System.err.println(e.getMessage()); Connection con=drivermanager.getconnection(l,"sa","");
125 7 JDBC 119 Statement stmt = con.createstatement(); stmt.executeupdate("delete from TITLES where price=18"); ResultSet rs=stmt.executequery("select * from TITLES"); while(rs.next()) for(int i=1;i<11;i++) System.out.println(" " + i + " " + rs.getstring(i)); con.close(); catch(sqlexception ex) while(ex!=null) System.out.println(" "); System.out.println(ex.getSQLState()); System.out.println(ex.getMessage()); System.out.println(ex.getErrorCode()); ex=ex.getnextexception(); 18 1 BU The Busy Executive's Database Guide 3 business An overview of available database systems with emphasis on common business applications. Illustrated :00: BU Cooking with Computers: Surreptitious Balance Sheets 3 business
126 120 Java Helpful hints on how to use your electronic resources to the best advantage :00: BU You Can Combat Computer Stress! 3 business The latest medical and psychological techniques for living with the electronic office. Easy-to-understand explanations :00: BU Straight Talk About Computers 3 business Annotated analysis of what computers can do for you: a no-hype guide for the critical user :00: MC Silicon Valley Gastronomic Treats 3 mod_cook Favorite recipes for quick, easy, and elegant meals :00: MC The Gourmet Microwave
127 7 JDBC mod_cook Traditional French gourmet recipes adapted for modern microwave cooking :00: MC The Psychology of Computer Cooking 3 UNDECIDED null 6 null 7 null 8 null 9 null :10: PC But Is It User Friendly? 3 popular_comp A survey of software for the naive user, focusing on the 'friendliness' of each :00: PC Secrets of Silicon Valley 3 popular_comp Muckraking reporting on the world's largest computer hardware and software manufacturers.
128 122 Java :00: PC Net Etiquette 3 popular_comp null 6 null 7 null 8 null 9 A must-read for computer conferencing :10: PS Computer Phobic AND Non-Phobic Individuals: Behavior Variations 3 psychology A must for the specialist,this book examines the difference between those who hate and fear computers and those who don't :00: PS Is Anger the Enemy? 3 psychology Carefully researched study of the effects of strong emotions on the body. Metabolic charts included :00: PS Life Without Fear 3 psychology
129 7 JDBC New exercise, meditation, and nutritional techniques that can reduce the shock of daily interactions. Popular audience. Sample menus included, exercise video available. separately :00: PS Prolonged Data Deprivation: Four Case Studies 3 psychology What happens when the data runs dry?searching evaluations of information-shortage effects :00: PS Emotional Security: A New Algorithm 3 psychology Protecting yourself and your loved ones from undue emotional stress in the modern world. Use of computer and nutritional aids emphasized :00: TC Onions, Leeks, and Garlic: Cooking Secrets of the Mediterranean 3 trad_cook Profusely illustrated in color, this makes a wonderful gift book for a cuisine-oriented friend :00:00.000
130 124 Java 1 TC Fifty Years in Buckingham Palace Kitchens 3 trad_cook More anecdotes from the Queen's favorite cook describing life among English royalty. Recipes, techniques, tender vignettes :00: TC Sushi, Anyone? 3 trad_cook Detailed instructions on how to make authentic Japanese sushi in your spare time :00: Statement executeupdate (1) Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); (2) Connection con=drivermanager.getconnection(l,"sa",""); Connection (3) Statement stmt = con.createstatement(); Statement (4) stmt.executeupdate("delete from TITLES where price=18"); (5) ResultSet rs=stmt.executequery("select * from TITLES"); while(rs.next()) for(int i=1;i<11;i++) System.out.println(" " + i + " " + rs.getstring(i)); con.close();
131 7 JDBC JDBC JDBC Statement 1 SQL Server PUBS TITLES import java.net.url; import java.sql.*; class Delete public void main(string args[]) String l="jdbc:odbc:pub"; try try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); catch(java.lang.classnotfoundexception e) System.err.print("ClassNotFoundException: "); System.err.println(e.getMessage()); Connection con=drivermanager.getconnection(l,"sa",""); Statement stmt = con.createstatement(); stmt.executeupdate("update TITLES SET TYPE= BUSI_BOOK WHERE PRICE<18 AND PRICE > 12"); ResultSet rs=stmt.executequery("select * from TITLES"); while(rs.next()) for(int i=1;i<11;i++) System.out.println(" " + i + " " + rs.getstring(i));
132 126 Java con.close(); catch(sqlexception ex) while(ex!=null) System.out.println(" "); System.out.println(ex.getSQLState()); System.out.println(ex.getMessage()); System.out.println(ex.getErrorCode()); ex=ex.getnextexception(); 12~18 BUSI_BOOK 1 BU The Busy Executive's Database Guide 3 business An overview of available database systems with emphasis on common business applications. Illustrated :00: BU Cooking with Computers: Surreptitious Balance Sheets 3 business Helpful hints on how to use your electronic resources to the best advantage :00: BU2075
133 7 JDBC You Can Combat Computer Stress! 3 business The latest medical and psychological techniques for living with the electronic office. Easy-to-understand explanations :00: BU Straight Talk About Computers 3 business Annotated analysis of what computers can do for you: a no-hype guide for the critical user :00: MC Silicon Valley Gastronomic Treats 3 mod_cook Favorite recipes for quick, easy, and elegant meals :00: MC The Gourmet Microwave 3 mod_cook Traditional French gourmet recipes adapted for modern microwave
134 128 Java cooking :00: MC The Psychology of Computer Cooking 3 UNDECIDED null 6 null 7 null 8 null 9 null :10: PC But Is It User Friendly? 3 popular_comp A survey of software for the naive user, focusing on the 'friendliness' of each :00: PC Secrets of Silicon Valley 3 popular_comp Muckraking reporting on the world's largest computer hardware and software manufacturers :00: PC Net Etiquette 3 popular_comp null 6 null
135 7 JDBC null 8 null 9 A must-read for computer conferencing :10: PS Computer Phobic AND Non-Phobic Individuals: Behavior Variations 3 psychology A must for the specialist,this book examines the difference between those who hate and fear computers and those who don't :00: PS Is Anger the Enemy? 3 psychology Carefully researched study of the effects of strong emotions on the body. Metabolic charts included :00: PS Life Without Fear 3 psychology New exercise, meditation, and nutritional techniques that can reduce the shock of daily interactions. Popular audience. Sample menus included, exercise video available separately :00: PS3333
136 130 Java 2 Prolonged Data Deprivation: Four Case Studies 3 psychology What happens when the data runs dry? Searching evaluations of information-shortage effects :00: PS Emotional Security: A New Algorithm 3 psychology Protecting yourself and your loved ones from undue emotional stress in the modern world. Use of computer and nutritional aids emphasized :00: TC Onions, Leeks, and Garlic: Cooking Secrets of the Mediterranean 3 trad_cook Profusely illustrated in color, this makes a wonderful gift book for a cuisine-oriented friend :00: TC Fifty Years in Buckingham Palace Kitchens 3 trad_cook
137 7 JDBC More anecdotes from the Queen's favorite cook describing life among English royalty. Recipes, techniques, tender vignettes :00: TC Sushi, Anyone? 3 busi_book Detailed instructions on how to make authentic Japanese sushi in your spare time :00: (1) Statement executeupdate (2) Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); (3) Connection con=drivermanager.getconnection(l,"sa",""); Connection (4) Statement stmt = con.createstatement(); Statement (5) stmt.executeupdate("update TITLES SET TYPE= BUSI_BOOK WHERE PRICE<18 AND PRICE > 12"); (6) ResultSet rs=stmt.executequery("select * from TITLES"); (7) while(rs.next()) for(int i=1;i<11;i++) System.out.println(" " + i + " " + rs.getstring(i)); (8) con.close(); 7.6 PreparedStatement PreparedStatement PreparedStatement Statement PreparedStatement SQL
138 132 Java PreparedStatement SQL IN IN SQL IN setxxx PreparedStatement Statement SQL PreparedStatement Statement PreparedStatement Statement IN execute executequery executeupdate Statement SQL PreparedStatement PreparedStatement PreparedStatement import java.net.url; import java.sql.*; class Prepared public static void main(string args[]) String l="jdbc:odbc:pub"; try try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); catch(java.lang.classnotfoundexception e) System.err.print("ClassNotFoundException: "); System.err.println(e.getMessage()); Connection con=drivermanager.getconnection(l,"nkwht",""); Statement stmt = con.createstatement(); PreparedStatement sp=con.preparestatement("update titles set type='computer' where title_id=?"); sp.setstring(1,"bu1032"); sp.executeupdate(); ResultSet rs=stmt.executequery("select * from Titles"); while(rs.next())
139 7 JDBC 133 for(int i=1;i<4;i++) System.out.println(" " + i + " " + rs.getstring(i)); con.close(); catch(sqlexception ex) while(ex!=null) System.out.println(" "); System.out.println(ex.getSQLState()); System.out.println(ex.getMessage()); System.out.println(ex.getErrorCode()); ex=ex.getnextexception(); 1 BU The Busy Executive's Database Guide 3 computer An overview of available database systems with emphasis on common business applications. Illustrated :00: BU Cooking with Computers: Surreptitious Balance Sheets 3 business
140 134 Java 9 Helpful hints on how to use your electronic resources to the best advantage :00: BU You Can Combat Computer Stress! 3 business The latest medical and psychological techniques for living with the electronic office. Easy-to-understand explanations :00: BU Straight Talk About Computers 3 business Annotated analysis of what computers can do for you: a no-hype guide for the critical user :00: MC Silicon Valley Gastronomic Treats 3 mod_cook Favorite recipes for quick, easy, and elegant meals :00: MC The Gourmet Microwave 3 mod_cook
141 7 JDBC Traditional French gourmet recipes adapted for modern microwave cooking :00: MC The Psychology of Computer Cooking 3 UNDECIDED null 6 null 7 null 8 null 9 null :10: PC But Is It User Friendly? 3 popular_comp A survey of software for the naive user, focusing on the 'friendliness' of each :00: PC Secrets of Silicon Valley 3 popular_comp Muckraking reporting on the world's largest computer hardware and software manufacturers :00: PC Net Etiquette
142 136 Java 3 popular_comp null 6 null 7 null 8 null 9 A must-read for computer conferencing :10: PS Computer Phobic AND Non-Phobic Individuals: Behavior Variations 3 psychology A must for the specialist,this book examines the difference between those who hate and fear computers and those who don't :00: PS Is Anger the Enemy? 3 psychology Carefully researched study of the effects of strong emotions on the body. Metabolic charts included :00: PS Life Without Fear 3 psychology New exercise, meditation, and nutritional techniques that can
143 7 JDBC 137 reduce the shock of daily interactions. Popular audience. Sample menus included, exercise video available separately :00: PS Prolonged Data Deprivation: Four Case Studies 3 psychology What happens when the data runs dry?searching evaluations of information-shortage effects :00: PS Emotional Security: A New Algorithm 3 psychology Protecting yourself and your loved ones from undue emotional stress in the modern world. Use of computer and nutritional aids emphasized :00: TC Onions, Leeks, and Garlic: Cooking Secrets of the Mediterranean 3 trad_cook Profusely illustrated in color, this makes a wonderful gift book for a cuisine-oriented friend :00: TC Fifty Years in Buckingham Palace Kitchens 3 trad_cook
144 138 Java More anecdotes from the Queen's favorite cook describing life among English royalty. Recipes, techniques, tender vignettes :00: TC Sushi, Anyone? 3 busi_book Detailed instructions on how to make authentic Japanese sushi in your spare time :00: BU1032 computer preparedstatement PreparedStatement 1 PreparedStatement con Connection IN SQL PreparedStatement PreparedStatement pstmt = con.preparestatement( "UPDATE table4 SET m =? WHERE x =?"); pstmt "UPDATE table4 SET m =? WHERE x =?" DBMS 2 IN PreparedStatement? setxxx XXX Java long setlong setxxx pstmt.setlong(1, ); pstmt.setlong(2, ); clearparameters
145 7 JDBC 139 PreparedStatement PreparedStatement Statement pstmt PreparedStatement pstmt 10 pstmt Hi for 0 9 pstmt.setstring(1, "Hi"); for (int i = 0; i < 10; i++) pstmt.setint(2, i); int rowcount = pstmt.executeupdate(); 3 IN setxxx XXX Java JDBC SQL Java JDBC JDBC Guide Java JDBC JDBC PreparedStatement pstmt 44 Java short pstmt.setshort(2, 44); 44 JDBC SMALLINT Java short IN Java JDBC JDBC JDBC SMALLINT setbyte JDBC TINYINT TINYINT SMALLINT JDBC Java JDBC SMALLINT setshort setbyte 4 setobject setobject JDBC JDBC Java Object JDBC JDBC Java Object JDBC setxxx Java JDBC setxxx Java JDBC setobject Java Object JDBC setobject Java setobject
146 140 Java Java JDBC 5. JDBC NULL IN setnull JDBC NULL IN JDBC Java null setxxx Java JDBC NULL JDBC setobject null 6. IN setbytes setstring IN Java JDBC JDBC IN setbinarystream setasciistream ASCII setunicodestream Unicode setxxx IN java.io.file file = new java.io.file("/tmp/data"); int filelength = file.length(); java.io.inputstream fin = new java.io.fileinputstream(file); java.sql.preparedstatement pstmt = con.preparestatement( "UPDATE Table5 SET stuff =? WHERE index = 4"); pstmt.setbinarystream (1, fin, filelength); pstmt.executeupdate(); fin 7.7 CallableStatement JDBC CallableStatement CallableStatement CallableStatement DBMS CallableStatement (OUT) IN OUT INOUT JDBC
147 7 JDBC 141 call [(?,?,...)]? = call [(?,?,...)] call CallableStatement DBMS DatabaseMetaData DBMS supportsstoredprocedures true getprocedures CallableStatement Statement SQL PreparedStatement IN CallableStatement OUT INOUT OUT JDBC SQL JDBC NULL CallableStatement import java.net.url; import java.sql.*; class Call public static void main(string args[]) String l="jdbc:odbc:pub"; try try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); catch(java.lang.classnotfoundexception e) System.err.print("ClassNotFoundException: "); System.err.println(e.getMessage()); Connection con=drivermanager.getconnection(l,"nkwht",""); Statement stmt = con.createstatement(); CallableStatement cstmt=con.preparecall("call TITLE_SELECT(?)");
148 142 Java cs.setstring(1,"bu1032"); ResultSet rs=sp.executequery(); while(rs.next()) for(int i=1;i<4;i++) System.out.println(" " + i + " " + rs.getstring(i)); con.close(); catch(sqlexception ex) while(ex!=null) System.out.println(" "); System.out.println(ex.getSQLState()); System.out.println(ex.getMessage()); System.out.println(ex.getErrorCode()); ex=ex.getnextexception(); 1 BU The Busy Executive's Database Guide 3 computer An overview of available database systems with emphasis on common business applications. Illustrated :00: CallableStatement CallableStatement
149 7 JDBC 143 CallableStatement Connection preparecall CallableStatement gettestdata CallableStatement cstmt = con.preparecall( "call gettestdata(?,?)");? IN OUT INOUT gettestdata 2 IN OUT IN CallableStatement setxxx PreparedStatement setxxx setfloat float OUT CallableStatement OUT JDBC DBMS JDBC JDBC registeroutparameter CallableStatement getxxx getxxx JDBC Java registeroutparameter JDBC JDBC getxxx Java OUT cstmt OUT getbyte OUT Java getbigdecimal OUT BigDecimal CallableStatement cstmt = con.preparecall( "call gettestdata(?,?)"); cstmt.registeroutparameter(1, java.sql.types.tinyint); cstmt.registeroutparameter(2, java.sql.types.decimal, 3); cstmt.executequery(); byte x = cstmt.getbyte(1); java.math.bigdecimal n = cstmt.getbigdecimal(2, 3); CallableStatement ResultSet OUT 3 INOUT INOUT registeroutparameter setxxx PreparedStatement setxxx registeroutparameter JDBC setxxx Java JDBC IN JDBC registeroutparameter JDBC getxxx Java byte setbyte registeroutparameter TINYINT JDBC getbyte
150 144 Java revisetotal INOUT setbyte 25 JDBC TINYINT registeroutparameter JDBC TINYINT JDBC TINYINT getbyte Java byte CallableStatement cstmt = con.preparecall( "call revisetotal(?)"); cstmt.setbyte(1, 25); cstmt.registeroutparameter(1, java.sql.types.tinyint); cstmt.executeupdate(); byte x = cstmt.getbyte(1); 4 OUT DBMS CallableStatement CallableStatement.getXXX OUT CallableStatement ResultSet execute OUT Statement getresultset getupdatecount getmoreresults CallableStatement.getXXX OUT 5 OUT NULL OUT JDBC NULL JDBC NULL getxxx null 0 false getxxx ResultSet 0 false JDBC NULL wasnull getxxx JDBC NULL true flase 5 ResultSet PreparedStatement 3 PreparedStatement void addbatch() void clearparameters() boolean execute()
151 7 JDBC 145 ResultSet executequery() int executeupdate() ResultSetMetaData getmetadata() void setarray(int i, Array x) void setasciistream(int parameterindex, InputStream x, int length) void setbigdecimal(int parameterindex, BigDecimal x) void setbinarystream(int parameterindex, InputStream x, int length) void setblob(int i, Blob x) void setboolean(int parameterindex, boolean x) void setbyte(int parameterindex, byte x) void setbytes(int parameterindex, byte[] x) void setcharacterstream(int parameterindex, Reader reader, int length) void setclob(int i, Clob x) void setdate(int parameterindex, Date x) void setdate(int parameterindex, Date x, Calendar cal) void setdouble(int parameterindex, double x) void setfloat(int parameterindex, float x) void setint(int parameterindex, int x) void setlong(int parameterindex, long x) void setnull(int parameterindex, int sqltype) void setnull(int paramindex, int sqltype, String typename) void setobject(int parameterindex, Object x) void setobject(int parameterindex, Object x, int targetsqltype) void setobject(int parameterindex, Object x, int targetsqltype, int scale) void setref(int i, Ref x) void setshort(int parameterindex, short x) void setstring(int parameterindex, String x) void settime(int parameterindex, Time x) void settime(int parameterindex, Time x, Calendar cal) void settimestamp(int parameterindex, Timestamp x) void settimestamp(int parameterindex, Timestamp x, Calendar cal) void setunicodestream(int parameterindex, InputStream x, int length)
152 8 JDBC JDBC 8.1 JDBC JDBC JDBC 1 import java.net.url; import java.sql.*; class CreateTable public static void main(string args[]) String l="jdbc:odbc:pub"; try try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); catch(java.lang.classnotfoundexception e) System.err.print("ClassNotFoundException: "); System.err.println(e.getMessage()); Connection con=drivermanager.getconnection(l,"nkwht",""); String sql="create table MyTable(user_name char(20),user_age int,user_lobby char(30))"; Statement stmt = con.createstatement(); stmt.executeupdate(sql);
153 8 JDBC 147 con.close(); catch(sqlexception ex) while(ex!=null) System.out.println(" "); System.out.println(ex.getSQLState()); System.out.println(ex.getMessage()); System.out.println(ex.getErrorCode()); ex=ex.getnextexception(); SQL Server PUBS MyTable, (1) Statement executeupdate (2) Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); (3) Connection con=drivermanager.getconnection(l,"sa",""); Connection
154 148 Java 8.2 (4) Statement stmt = con.createstatement(); Statement (5) stmt.executeupdate("create table MyTable(user_name char(20),user_age int, user_ lobby char(30))"); (6) con.close(); Statement executeupdate 8.2 JDBC JDBC 1 MyTable import java.net.url; import java.sql.*; class DropTable public static void main(string args[]) String l="jdbc:odbc:pub"; try try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
155 8 JDBC 149 catch(java.lang.classnotfoundexception e) System.err.print("ClassNotFoundException: "); System.err.println(e.getMessage()); Connection con=drivermanager.getconnection(l,"nkwht",""); String sql="drop Table MyTable"; Statement stmt = con.createstatement(); stmt.executeupdate(sql); con.close(); catch(sqlexception ex) while(ex!=null) System.out.println(" "); System.out.println(ex.getSQLState()); System.out.println(ex.getMessage()); System.out.println(ex.getErrorCode()); ex=ex.getnextexception(); SQL Server PUBS My Table
156 150 Java My Table 2 stmt.executeupdate("drop Table MyTable ); 8.3 JDBC import java.net.url; import java.sql.*; class CreateView public static void main(string args[]) String l="jdbc:odbc:pub"; try try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); catch(java.lang.classnotfoundexception e) System.err.print("ClassNotFoundException: "); System.err.println(e.getMessage()); Connection con=drivermanager.getconnection(l,"nkwht",""); String sql="create view MyView as select title,type,price from titles"; Statement stmt = con.createstatement(); stmt.executeupdate(sql); ResultSet rs=stmt.executequery("select * from MyView"); while(rs.next())
157 8 JDBC 151 for(int i=1;i<4;i++) System.out.println(" " + i + " " + rs.getstring(i)); con.close(); catch(sqlexception ex) while(ex!=null) System.out.println(" "); System.out.println(ex.getSQLState()); System.out.println(ex.getMessage()); System.out.println(ex.getErrorCode()); ex=ex.getnextexception(); 1 The Busy Executive's Database Guide 2 business Cooking with Computers: Surreptitious Balance Sheets 2 business You Can Combat Computer Stress! 2 business Straight Talk About Computers 2 business Silicon Valley Gastronomic Treats 2 mod_cook The Gourmet Microwave 2 mod_cook
158 152 Java 1 The Psychology of Computer Cooking 2 UNDECIDED 3 null 1 But Is It User Friendly? 2 popular_comp Secrets of Silicon Valley 2 popular_comp Net Etiquette 2 popular_comp 3 null 1 Computer Phobic AND Non-Phobic Individuals: Behavior Variations 2 psychology Is Anger the Enemy? 2 psychology Life Without Fear 2 psychology Prolonged Data Deprivation: Four Case Studies 2 psychology Emotional Security: A New Algorithm 2 psychology Onions, Leeks, and Garlic: Cooking Secrets of the Mediterranean 2 trad_cook Fifty Years in Buckingham Palace Kitchens 2 trad_cook Sushi, Anyone? 2 busi_book SQL Server PUBS 8.4
159 8 JDBC stmt.executeupdate("create view MyView as select title,type,price from titles"); import java.net.url; import java.sql.*; class DropView public static void main(string args[]) String l="jdbc:odbc:pub"; try try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); catch(java.lang.classnotfoundexception e)
160 154 Java System.err.print("ClassNotFoundException: "); System.err.println(e.getMessage()); Connection con=drivermanager.getconnection(l,"nkwht",""); String sql="drop View MyView"; Statement stmt = con.createstatement(); stmt.executeupdate(sql); con.close(); catch(sqlexception ex) while(ex!=null) System.out.println(" "); System.out.println(ex.getSQLState()); System.out.println(ex.getMessage()); System.out.println(ex.getErrorCode()); ex=ex.getnextexception(); SQL Server PUBS MyView
161 8 JDBC DBA 2 JDBC JDBC Connection 3
162 9 9.1 Servlet Servlets Java 2.0 Java Servlets / Java-enabled web,, servlet HTML servlet CGI WEB servlet CGI, CGI servlet Java servlet Servlet API, servlet, servlet CGI, servlet, servlets web Servlet CGI : Servlet Java Servlet API, a standard Java extension Java 9.2 Servlet servlet HTML HTTPS POSTed, servlet, servlet ; Servlet servlets servlet servlet,
163 Servlet servlet Java Java Servlet API Servlet interface servlets implement ( ) HttpServlet Servlet interface servlet Servlet servlet servlet, ServletRequest ServletResponse ServletRequest class, ServletResponse class servlet ServletRequest interface, servlet, ServletInputStream, HTTP POST PUT ServletRequest servlet : HttpServletRequest HTTP-specific ServletResponse interface servlet servlet mime,, ServletOutputStream, ServletResponse protocol-specific : HttpServletResponse servlet HTTP-specific classes interfaces Servlet HTTP servlets session-tracking capabilities servlet API servlet 9.4 Servlet servlets servlets servlets lifecycle servlet, servlet init servlet destroy servlet servlet, servlet service service :, Servlets service,, service thread-safe service servlet field, service SingleThreadModel interface interface threads Servlets servlet lifecycle, thread-safe servlet
164 158 Java 9.5 Servlet SUN JSWDK Serverlet Serverlet JSWDK 1 JDK Servlet Java_Home JDK ClassPath JSWDK JSWDK Serverlet.jar javax AutoExec.bat set classpath=c:\jdk1.3.0_01\serverlet set java_home=c:\jdk1.3.0_01 javax C:\jdk1.3.0_01\serverlet JDK C:\jdk1.3.0_01\ 2 C:\serverlet\jswdk startserver.bat
165 stopserver.bat
166 160 Java 9.6 Servlet Servlet import java.io.*; import java.servlet.*; import javax.servlet.*; public class HelloWorld extends HttpServlet public void doget(httpservletrequest request, HttpServletResponse response) throws IOException, ServletException response.setcontenttype("text/html"); PrintWriter out = response.getwriter(); out.println("<html>"); out.println("<body>"); out.println("<head>"); out.println("<title>hello World!</title>"); out.println("</head>"); out.println("<body>"); out.println("<h1>hello World!</h1>"); out.println("</body>"); out.println("</html>"); Hello World
167 9 161 import javax.servlet.*; Servlet Servlet HttpServlet GenericServerlet HTTP doget dopost HTTP get post HTTP 1.1 HTTP Service response.setcontenttype("text/html"); PrintWriter out = response.getwriter(); out.println("<html>"); out.println("<body>"); out.println("<head>"); out.println("<title>hello World!</title>"); out.println("</head>"); out.println("<body>"); out.println("<h1>hello World!</h1>"); out.println("</body>"); out.println("</html>"); HTML import java.io.*; import java.servlet.*; import javax.servlet.*; public class RequestInfo extends HttpServlet public void doget(httpservletrequest request, HttpServletResponse response) throws IOException, ServletException response.setcontenttype("text/html"); PrintWriter out = response.getwriter(); out.println("<html>"); out.println("<body>"); out.println("<head>"); out.println("<title>request Information Example</title>"); out.println("</head>"); out.println("<body>"); out.println("<h3>request Information Example</h3>"); out.println("method: " + request.getmethod()); out.println("request URI: " + request.getrequesturi()); out.println("protocol: " + request.getprotocol()); out.println("pathinfo: " + request.getpathinfo());
168 162 Java out.println("remote Address: " + request.getremoteaddr()); out.println("</body>"); out.println("</html>"); /** * We are going to perform the same operations for POST requests * as for GET methods, so this method just sends the request to * the doget method. */ public void dopost(httpservletrequest request, HttpServletResponse res) throws IOException, ServletException doget(request, response); HttpServletRequest getmethod() getrequesturi() import java.io.*; import java.servlet.*; import javax.servlet.*; public class RequestHeaderExample extends HttpServlet
169 9 163 public void doget(httpservletrequest request, HttpServletResponse response) throws IOException, ServletException response.setcontenttype("text/html"); PrintWriter out = response.getwriter(); Enumeration e = req.getheadernames(); while (e.hasmoreelements()) String name = (String)e.nextElement(); String value = req.getheader(name); out.println(name + " = " + value); Http 9.7 Servlet Servlet Servlet * Servlet
170 164 Java */ import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import java.util.*; /* WEB HTTP */ public class ReqInfoServlet extends HttpServlet /* req HttpServletRequest res HttpServletResponse */ public void service(httpservletrequest req, HttpServletResponse res) throws IOException ServletOutputStream os; Enumeration paramnames; String paramname, paramvalue; Enumeration hdrnames; String hdrdate, hdrname, hdrvalue; /* */ res.setcontenttype("text/plain"); PrintWriter pw = new PrintWriter(res.getOutputStream()); /* */ pw.println("request protocol is " + req.getprotocol()); pw.println("request scheme is " + req.getscheme()); /* */ pw.println("remote host is " + req.getremotehost()); pw.println("remote address is " + req.getremoteaddr()); /* */ pw.println("receiving server is " + req.getservername() + " on port number " + req.getserverport()); /* */ hdrnames = req.getheadernames(); /* Enumeration */ pw.println(); pw.println("header data is:");
171 9 165 while(hdrnames.hasmoreelements()) /* hdrname = (String)hdrNames.nextElement(); /* hdrvalue = (String)req.getHeader(hdrName); /* pw.println("name = " + hdrname + "; value = " + hdrvalue); pw.println(); paramnames = req.getparameternames(); /* Enumeration */ pw.println("request parameters are:"); while(paramnames.hasmoreelements()) paramname = (String)paramNames.nextElement(); paramvalue = (String)req.getParameter(paramName); pw.println("name = " + paramname + "; value = " + paramvalue); /* pw.flush(); pw.close(); // service() // Req Info Servlet
172 166 Java Servlet Servlet Java 2 Servlet Servlet IT Servlet IT 3 Servlet HTTP HTTP Servlet 4 Servlet HttpServlet HttpServletRequest HttpServletResponse Servlet
173 10 Web Servlet Web Web Mail Servlet CGI CGI Servlet Servlet Web 10.1 Web HTML 1. <Form> </Form> <HR> FORM HTML FORM METHOD " " ACTION "URL " [ENCTYPE=" "] <INPUT TYPE=" " NAME=" "> /FORM ACTION URL URL HTTP METHOD HTTP GET POST GET GET URL POST ENCTYPE x www form encoded INPUT SELECT TEXTAREA HTML
174 168 Java 2. TEXTAREA SELECT INPUT INPUT TYPE FORM SUBMIT FROM TEXT RADIO Windows CHECKBOX PASSWORD HIDDEN IMAGE RESET TYPE INPUT HTML TYPE TYPE= text INPUT SELECT TEXTAREA NAME SELECTION <SELECT NAME " " > <OPTION> <OPTION> </SELECT> <HTML> <HEAD> <TITLE> </TITLE> </HEAD> <BODY > <PRE> <FORM METHOD=POST ACTION=" TARGET="_top"> <B> <B><INPUT NAME="mm" TYPE=text SIZE=8 > <B> </B><INPUT NAME="xm" TYPE=text SIZE=8 > <B> </B><INPUT NAME="sfz" TYPE=text SIZE=15> <B> </B><INPUT NAME="sr" TYPE=text SIZE=8 > <INPUT NAME="ok" TYPE=submit VALUE=" ">
175 10 Web 169 <INPUT NAME="cancel" TYPE=reset VALUE=" "> </FORM> </PRE> </BODY> </HTML> <HTML> <HEAD> <TITLE>This is also a test!</title> </HEAD> <BODY > <INPUT TYPE=" text" NAME="wby" SIZE= 50 VALUE " "> </BODY> </HTML> TEXT INPUT SIZE MAXLENGTH MAXLENGTH VALUE IE 10.2
176 170 Java TEXTAREA INPUT <HTML> <HEAD> <TITLE>This is also a test!</title> </HEAD> <BODY > <TEXTAREA NAME="dhwby" ROWS=10 COLS=50> </TEXTAREA> </BODY> </HTML> ROWS COLS <TEXTAREA> </TEXTAREA> TEXTAREA IE <HTML> <HEAD> <TITLE>This is also a test!</title> </HEAD>
177 10 Web <BODY > <INPUT TYPE="password" NAME="mm" SIZE=10 VALUE=" "> </BODY> </HTML> TYPE="password" INPUT IE INPUT TYPE " hidden"
178 172 Java <HTML> <HEAD> <TITLE>This is also a test!</title> </HEAD> <BODY > <INPUT TYPE= "hidden" NAME="state" VALUE=" state-information" > </BODY> </HTML> HTML hidden secret IE <HTML> <HEAD> <TITLE>This is also a test!</title> </HEAD> <BODY >
179 10 Web 173 <INPUT TYPE="radio" NAME="dx" VALUE="a" CHECKED>a <INPUT TYPE= "radio" NAME="dx" VALUE="b">b <INPUT TYPE="radio" NAME="dx" VALUE="c" > c </BODY> </HTML> TYPE="radio" INPUT NAME VALUE CHECKED CHECKED CHECKED CHECKED IE <HTML> <HEAD> <TITLE>This is also a test!</title> </HEAD> <BODY > <INPUT TYPE= "checkbox" NAME="fxk" VALUE=a CHECKED>a <INPUT TYPE="checkbox" NAME="fxk" VALUE b CHECKED > b
180 174 Java <INPUT TYPE="checkbox" NAME="fxk" VALUE=c>c <INPUT TYPE="checkbox" NAME="fxk" VALUE=d>d <INPUT TYPE="checkbox" NAME="fxk" VALUE=e >e </BODY> </HTML> TYPE="checkbox" INPUT VALUE CHECKBOX IE <HTML> <HEAD> <TITLE>This is also a test!</title> </HEAD> <BODY> <SELECT NAME="xz" > <OPTION SELECTED>option 1 <OPTION>option 2 <OPTION>option 3 <OPTION>option 4 </SELECT> </BODY> </HTML>
181 10 Web 175 SELECT INPUT OPTION OPTION SELECT SELECT MULTIPLE OPTION SELECT OPTION VALUE IE HIML <HTML> <HEAD> <TITLE>This is also a test!</title> </HEAD> <BODY> <INPUT TYPE="reset" VALUE = " " > </BODY> </HTML> TYPE="reset" INPUT VALUE reset NAME IE 10.9
182 176 Java <HTML> <HEAD> <TITLE>This is also a test!</title> </HEAD> <BODY> <INPUT TYPE="submit" NAME="tj" VALUE=" "> </BODY> </HTML> TYPE="submit" INPUT VALUE submit NAME IE
183 10 Web Servlet 1 Form Servlet import java.io.*; import java.servlet.*; import javax.servlet.*; public class RequestParamExample extends HttpServlet public void doget(httpservletrequest request, HttpServletResponse response) throws IOException, ServletException response.setcontenttype("text/html"); PrintWriter out = response.getwriter(); out.println("get Request. No Form Data Posted"); public void dopost(httpservletrequest request, HttpServletResponse res) throws IOException, ServletException Enumeration e = request.getparameternames(); PrintWriter out = res.getwriter (); while (e.hasmoreelements()) String name = (String)e.nextElement(); String value = request.getparamter(name); out.println(name + " = " + value); <html> <body> <head> <title>request Parameters Example</title> </head> <body bgcolor="white">
184 178 Java <a href="../servlets/reqparams.html"> <img src="../images/code.gif" height=24 width=24 align=right border=0 alt="view code"></a> <a href="../servlets/index.html"> <img src="../images/return.gif" height=24 width=24 align=right border=0 alt="return"></a> <h3>request Parameters Example</h3> Parameters in this request:<br> No Parameters, Please enter some <P> <form action="requestparamexample" method=post> First Name: <input type=text size=20 name=firstname> <br> Last Name: <input type=text size=20 name=lastname> <br> <input type=submit> </form> </body> </html>
185 10 Web Servlet Enumeration e = request.getparameternames(); String name = (String)e.nextElement(); String value = request.getparamter(name); NextElement() getparameter HttpRequest 2 Cookie Cookie Servlet Cookie Cookie <html> <body bgcolor="white"> <head> <title>cookies Example</title> </head> <body> <a href="../servlets/cookies.html"> <img src="../images/code.gif" height=24 width=24 align=right border=0 alt="view code"></a> <a href="../servlets/index.html"> <img src="../images/return.gif" height=24 width=24 align=right border=0 alt="return"></a>
186 180 Java <h3>cookies Example</h3> Your browser isn't sending any cookies <P> Create a cookie to send to your browser<br> <form action="cookieexample" method=post> Name: <input type=text length=20 name=cookiename><br> Value: <input type=text length=20 name=cookievalue><br> <input type=submit></form> </body> </html> Servlet import java.io.*; import java.servlet.*; import javax.servlet.*; public class CookieExample extends HttpServlet public void doget(httpservletrequest request, HttpServletResponse response) throws IOException, ServletException response.setcontenttype("text/html"); PrintWriter out = response.getwriter(); // print out cookies Cookie[] cookies = request.getcookies(); for (int i = 0; i < cookies.length; i++) Cookie c = cookies[i]; String name = c.getname(); String value = c.getvalue(); out.println(name + " = " + value); // set a cookie String name = request.getparamter("cookiename"); if (name!= null && name.length() > 0) String value = req.getparameter("cookievalue"); Cookie c = new Cookie(name, value); res.addcookie(c);
187 10 Web Servlet Cookie[] cookies = request.getcookies(); Cookies Cookie String name = c.getname(); String value = c.getvalue(); Cookie 3 Session Session Session
188 182 Java Session Session Session Session <html> <body bgcolor="white"> <head> <title>sessions Example</title> </head> <body> <a href="../servlets/sessions.html"> <img src="../images/code.gif" height=24 width=24 align=right border=0 alt="view code"></a> <a href="../servlets/index.html"> <img src="../images/return.gif" height=24 width=24 align=right border=0 alt="return"></a> <h3>sessions Example</h3> Session ID: To1010mC At <br> Created: Sat Mar 17 12:08:42 CST 2001<br> Last Accessed: Sat Mar 17 12:14:55 CST 2001 <P> The following data is in your session:<br> nkwht = 12511<br> <P> <form action="sessionexample" method=post> Name of Session Attribute: <input type=text size=20 name=dataname> <br> Value of Session Attribute: <input type=text size=20 name=datavalue> <br> <input type=submit> </form> </body> </html> </body> </html>
189 10 Web 183 Servlet import java.io.*; import java.servlet.*; import javax.servlet.*; public class SessionExample extends HttpServlet public void doget(httpservletrequest request, HttpServletResponse response) throws IOException, ServletException response.setcontenttype("text/html"); PrintWriter out = response.getwriter(); HttpSession session = request.getsession(true); // print session info Date created = new Date(session.getCreationTime()); Date accessed = new Date(session.getLastAccessedTime()); out.println("id " + session.getid()); out.println("created: " + created); out.println("last Accessed: " + accessed); // set session info if needed String dataname = request.getparameter("dataname"); if (dataname!= null && datename.length() > 0) String datavalue = request.getparameter("datavalue"); session.putvalue(dataname, datavalue); // print session contents String[] valuenames = session.getvaluenames(); if (valuenames!= null && valuenames.length > 0) for (int i = 0; i < valuenames.length; i++) String name = valuenames[i]; String value = session.getvalue(name).tostring(); out.println(name + " = " + value);
190 184 Java Servlet
191 10 Web 185 String[] valuenames = session.getvaluenames(); if (valuenames!= null && valuenames.length > 0) for (int i = 0; i < valuenames.length; i++) String name = valuenames[i]; String value = session.getvalue(name).tostring(); out.println(name + " = " + value); 2 Session HttpSession session = request.getsession(true); // print session info Date created = new Date(session.getCreationTime()); Date accessed = new Date(session.getLastAccessedTime()); out.println("id " + session.getid()); out.println("created: " + created); out.println("last Accessed: " + accessed); 3 Cookie? Cookie
192 11 Web JDBC Servlet, Servlet JDBC CGI Servlet + JDBC Servlet 11.1 Servlet Servlet import java.io.*; import java.servlet.*; import javax.servlet.*; import java.net.url; import java.sql.*; public class LinkData extends HttpServerlet Connection con; public void init(serverletconfig conf) throws ServerletException super.init();// String l="jdbc:odbc:test"; try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=drivermanager.getconnection(l,"nkwht",""); catch(exception e) //
193 11 Web 187 public void doget(httpservletrequest request, HttpServletResponse response) throws IOException, ServletException response.setcontenttype("text/html"); PrintWriter out = response.getwriter(); out.println("<html>"); out.println("<body>"); out.println("<head>"); out.println("<title> Serverlet </title>"); out.println("</head>"); out.println("<body>"); out.println("<h1>serverlet </h1>"); out.println("<pre>"); try DatabaseMetaData dma=con.getmetadata(); out.println(" :" + dma.geturl()); out.println("driver :"+ dma.getdrivername()); out.println("version :" + dma.getdriverversion()); out.println("</pre>"); con.close(); catch(sqlexception ex) while(ex!=null) out.println(" "); out.println(ex.getsqlstate()); out.println(ex.getmessage()); out.println(ex.geterrorcode()); ex=ex.getnextexception(); out.println("</body>"); out.println("</html>"); 11.1
194 188 Java 11.1 init Servlet 11.2 Servlet Servlet import java.io.*; import java.text.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import java.net.url; import java.sql.*; public class SelectData extends HttpServlet Connection con; public void init(servletconfig conf) throws ServletException
195 11 Web 189 super.init();// String l="jdbc:odbc:pub"; try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=drivermanager.getconnection(l,"sa",""); catch(exception e) // public void doget(httpservletrequest request, HttpServletResponse response) throws IOException, ServletException response.setcontenttype("text/html"); PrintWriter out = response.getwriter(); out.println("<html>"); out.println("<body>"); out.println("<head>"); out.println("<title> Serverlet </title>"); out.println("</head>"); out.println("<body>"); out.println("<h1>serverlet </h1>"); out.println("<pre>"); try Statement stmt = con.createstatement(); ResultSet rs=stmt.executequery("select * from TITLES"); while(rs.next()) for(int i=1;i<11;i++) out.println(" " + i + " " + rs.getstring(i)); con.close(); out.println("</pre>"); con.close(); catch(sqlexception ex)
196 190 Java while(ex!=null) out.println(" "); out.println(ex.getsqlstate()); out.println(ex.getmessage()); out.println(ex.geterrorcode()); ex=ex.getnextexception(); out.println("</body>"); out.println("</html>"); doget <pre> 11.3 Servlet import java.io.*; import java.text.*;
197 11 Web 191 import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import java.net.url; import java.sql.*; public class InsertData extends HttpServlet Connection con; public void init(servletconfig conf) throws ServletException super.init();// String l="jdbc:odbc:pub"; try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=drivermanager.getconnection(l,"sa",""); catch(exception e) // public void doget(httpservletrequest request, HttpServletResponse response) throws IOException, ServletException response.setcontenttype("text/html"); PrintWriter out = response.getwriter(); out.println("<html>"); out.println("<body>"); out.println("<head>"); out.println("<title> Serverlet </title>"); out.println("</head>"); out.println("<body>"); out.println("<h1>serverlet </h1>"); out.println("<pre>"); try Statement stmt = con.createstatement(); String sql="insert MyTable values(' ',"; for(int i=0;i<=100;i++)
198 192 Java stmt.executeupdate(sql + i +")"); ResultSet rs=stmt.executequery("select * from MyTable"); while(rs.next()) for(int i=1;i<3;i++) out.println(" " + i + " " + rs.getstring(i)); con.close(); out.println("</pre>"); con.close(); catch(sqlexception ex) while(ex!=null) out.println(" "); out.println(ex.getsqlstate()); out.println(ex.getmessage()); out.println(ex.geterrorcode()); ex=ex.getnextexception(); out.println("</body>"); out.println("</html>"); 11.3
199 11 Web Statement executepdate ResultSet 11.4 Servlet HTML Servlet HTML <html> <body> <head> <title> </title> </head> <body bgcolor="white"> <h1> </h1> <form action="deletedata" method=post> : <input type=text size=20 name=grade> <br> <input type=submit> </form> </body> </html> Servlet import java.io.*; import java.text.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import java.net.url; import java.sql.*; public class DeleteData extends HttpServlet Connection con; public void init(servletconfig conf) throws ServletException
200 194 Java super.init();// String l="jdbc:odbc:pub"; try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=drivermanager.getconnection(l,"sa",""); catch(exception e) // public void doget(httpservletrequest request, HttpServletResponse response) throws IOException, ServletException response.setcontenttype("text/html"); PrintWriter out = response.getwriter(); out.println("<html>"); out.println("<body>"); out.println("<head>"); out.println("<title> Serverlet </title>"); out.println("</head>"); out.println("<body>"); out.println("<h1>serverlet </h1>"); out.println("<pre>"); String grade=request.getparameter("grade"); out.println("<h2> :" + grade + "</h2>"); try Statement stmt = con.createstatement(); String sql="delete from MyTable where grade=" + grade; stmt.executeupdate(sql); ResultSet rs=stmt.executequery("select * from MyTable"); while(rs.next()) for(int i=1;i<3;i++)
201 11 Web 195 out.println(" " + i + " " + rs.getstring(i)); con.close(); out.println("</pre>"); con.close(); catch(sqlexception ex) while(ex!=null) out.println(" "); out.println(ex.getsqlstate()); out.println(ex.getmessage()); out.println(ex.geterrorcode()); ex=ex.getnextexception(); out.println("</body>"); out.println("</html>");
202 196 Java Servlet Servlet HTML <html> <body> <head> <title> </title> </head> <body bgcolor="white"> <h1> </h1> <form action=" method=post> : <input type=text size=20 name=grade> <br> : <input type=text size=20 name=name> <br> <input type=submit> </form>
203 11 Web 197 </body> </html> Servlet import java.io.*; import java.text.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import java.net.url; import java.sql.*; public class UpdateData extends HttpServlet Connection con; public void init(servletconfig conf) throws ServletException super.init();// String l="jdbc:odbc:pub"; try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=drivermanager.getconnection(l,"sa",""); catch(exception e) // public void doget(httpservletrequest request, HttpServletResponse response) throws IOException, ServletException response.setcontenttype("text/html"); PrintWriter out = response.getwriter(); out.println("<html>"); out.println("<body>"); out.println("<head>"); out.println("<title> Serverlet </title>"); out.println("</head>"); out.println("<body>"); out.println("<h1>serverlet </h1>");
204 198 Java out.println("<pre>"); String grade=request.getparameter("grade"); String name=request.getparameter("name"); try Statement stmt = con.createstatement(); String sql="update MyTable set name=" + name +"where grade=" + grade ; ResultSet rs=stmt.executequery("select * from MyTable"); while(rs.next()) for(int i=1;i<3;i++) out.println(" " + i + " " + rs.getstring(i)); con.close(); out.println("</pre>"); con.close(); catch(sqlexception ex) while(ex!=null) out.println(" "); out.println(ex.getsqlstate()); out.println(ex.getmessage()); out.println(ex.geterrorcode()); ex=ex.getnextexception(); out.println("</body>"); out.println("</html>"); SQL Servlet /
205 11 Web Servlet PreparedStatement PreparedStatement HTML <html> <body> <head>
206 200 Java <title>preparedstatement </title> </head> <body bgcolor="white"> <h1>preparedstatement </h1> <form action=" method=post> ID: <input type=text size=20 name=type_id> <br> : <input type=text size=20 name=type> <br> <input type=submit> </form> </body> </html> Servlet import java.io.*; import java.text.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import java.net.url; import java.sql.*; public class PreData extends HttpServlet Connection con; public void init(servletconfig conf) throws ServletException super.init();// String l="jdbc:odbc:pub"; try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=drivermanager.getconnection(l,"sa",""); catch(exception e) //
207 11 Web 201 public void doget(httpservletrequest request, HttpServletResponse response) throws IOException, ServletException response.setcontenttype("text/html"); PrintWriter out = response.getwriter(); out.println("<html>"); out.println("<body>"); out.println("<head>"); out.println("<title> Serverlet </title>"); out.println("</head>"); out.println("<body>"); out.println("<h1>serverlet </h1>"); out.println("<pre>"); String type_id=request.getparameter("type_id"); try Statement stmt = con.createstatement(); PreparedStatement sp=con.preparestatement("update titles set type=? where title_id=?"); sp.setstring(1,type); sp.setstring(2,title); SP.executeUpdate(); ResultSet rs=stmt.executequery("select * from TITLES"); while(rs.next()) for(int i=1;i<3;i++) out.println(" " + i + " " + rs.getstring(i)); con.close(); out.println("</pre>"); con.close(); catch(sqlexception ex) while(ex!=null) out.println(" "); out.println(ex.getsqlstate()); out.println(ex.getmessage()); out.println(ex.geterrorcode());
208 202 Java ex=ex.getnextexception(); out.println("</body>"); out.println("</html>");
209 11 Web 203 PreparedStatement Servlet 11.7 Servlet CallableStatement Servlet CallableStatement PUBS TITLES SQL Server SQL create procedure char(20) as update titles set where HTML <html> <body> <head> <title>callablestatement </title> </head> <body bgcolor="white"> <h1>callablestatement </h1>
210 204 Java <form action=" method=post> ID: <input type=text size=20 name=type_id> <br> : <input type=text size=20 name=type> <br> <input type=submit> </form> </body> </html> Servlet import java.io.*; import java.text.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import java.net.url; import java.sql.*; public class CallData extends HttpServlet Connection con; public void init(servletconfig conf) throws ServletException super.init();// String l="jdbc:odbc:pub"; try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=drivermanager.getconnection(l,"sa",""); catch(exception e) // public void doget(httpservletrequest request, HttpServletResponse response) throws IOException, ServletException response.setcontenttype("text/html");
211 11 Web 205 PrintWriter out = response.getwriter(); out.println("<html>"); out.println("<body>"); out.println("<head>"); out.println("<title> Serverlet </title>"); out.println("</head>"); out.println("<body>"); out.println("<h1>serverlet </h1>"); out.println("<pre>"); String title_id=request.getparameter("type_id"); String type=request.getparameter("type"); try Statement stmt = con.createstatement(); CallableStatement cstmt=con.preparecall("call us_serverlet(?.?)"); cs.setstring(1,type); cs.setstring(2,title_id); cs.executeupdate(); ResultSet rs=stmt.executequery("select * from TITLES"); while(rs.next()) for(int i=1;i<10;i++) out.println(" " + i + " " + rs.getstring(i)); con.close(); out.println("</pre>"); con.close(); catch(sqlexception ex) while(ex!=null) out.println(" "); out.println(ex.getsqlstate()); out.println(ex.getmessage()); out.println(ex.geterrorcode()); ex=ex.getnextexception(); out.println("</body>");
212 206 Java out.println("</html>"); Web Windows NT UNIX IBM WebSphere
213 11 Web IBM DB2 ORACLE MS SQL Server 3 Servlet Servlet JSWDK Servlet \jswdk-1.0.1\examples\web-inf\ servlets 4 Web HTML Java HTML HTML MS Front Page Dream Waver
214 12 Servlet JDBC Servlet Servlet+JDBC Web Servlet+JDBC SQL Server NEW DATABASE GUESTBOOK GUESTBOOK
215 12 Servlet GUESTBOOK 12.4~ HTML JDBC+Servlet 12.4
216 210 Java HTML <html> <head> <meta http-equiv="content-type" content="text/html; charset=gb2312"> <title> </title> <meta name="generator" content="microsoft FrontPage 3.0"> </head> <script language="vbscript"> sub ok()
217 12 Servlet if(trim(document.forms(0).elements(0).value)<>"" trim(document.forms(0).elements(1).value)<>"" trim(document.forms(0).elements(2).value)<>"" instr(document.forms(0).elements(2).value,"<")=0) then document.forms(0).submit and and and else alert "!" document.forms(0).reset() end if end sub </script> <body text="#0000a0" bgcolor="#ffffff"> <div align="center"><center> <table width="75%" border="0"> <tr> <td width="27%"><img src="daxueshenghuo.jpg" width="156" height="60"> </td> <td width="73%"><img src="ad-baby.gif" width="468" height="60"></td> </tr> </table> <p> </p>
218 212 Java </center> </div> <p align="center"><font color="#ff00ff"><big><big> </big> </big> </font> </p> <p align="center"> <font color="#ff0000"> <small> HTML, </small></font> </p> <form method="post" action="liuyanban"> <div align="center"> <center><p> <input type="text" name="name" size="15"> <input type="text" name="mail" size="30"> </p> </center></div><div align="center"> <center><p> </p> </center></div> <div align="center"> <center><p> <textarea rows="5" name="main" cols="30"> </textarea> </p> </center> </div> <div align="center"> <center> <p> <input type="button" value=" " name="b1" onclick="ok()"> <input type="reset" value=" " name="b2"> <input type="button"
219 12 Servlet 213 value=" " name="b3" onclick="window.location.href='watch.asp'"> </p> </center></div> </form> </body> </html> Servlet import java.io.*; import java.text.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import java.net.url; import java.sql.*; public class GuestBook extends HttpServlet Connection con;
220 214 Java public void init(servletconfig conf) throws ServletException super.init();// String l="jdbc:odbc:guestbook"; try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=drivermanager.getconnection(l,"sa",""); catch(exception e) // public void doget(httpservletrequest request, HttpServletResponse response) throws IOException, ServletException String name=request.getparameter("name"); String =request.getparameter(" "); String content=request.getparameter("content"); java.util.date to_day = new java.util.date(); String date_string=to_day.tostring(); response.setcontenttype("text/html"); PrintWriter out = response.getwriter(); out.println("<html>"); out.println("<body>"); out.println("<head>"); if(name.length()==0 .length()==0 content.length()==0 content.length()>500) // out.println("<title> </title>"); out.println("</head>"); out.println("<body>"); out.println("<h1>,,!</h1>"); out.println("</body>"); out.println("</html>"); return ; try
221 12 Servlet 215 Statement stmt = con.createstatement(); String sql="insert GUESTBOOK values("+name+","+ +","+content+", "+date_string+")"; stmt.executeupdate(sql); con.close(); out.println("<title> </title>"); out.println("</head>"); out.println("<body>"); out.println("<h1>!!</h1>"); catch(sqlexception ex) while(ex!=null) out.println(" "); out.println(ex.getsqlstate()); out.println(ex.getmessage()); out.println(ex.geterrorcode()); ex=ex.getnextexception(); out.println("</body>"); out.println("</html>"); import java.io.*; import java.text.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import java.net.url; import java.sql.*; public class WatchGuestBook extends HttpServlet Connection con; public void init(servletconfig conf) throws ServletException
222 216 Java super.init();// String l="jdbc:odbc:guestbook"; try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=drivermanager.getconnection(l,"sa",""); catch(exception e) // public void doget(httpservletrequest request, HttpServletResponse response) throws IOException, ServletException response.setcontenttype("text/html"); PrintWriter out = response.getwriter(); out.println("<html>"); out.println("<body>"); out.println("<head>"); out.println("<title> </title>"); out.println("</head>"); out.println("<body>"); out.println("<h1> </h1>"); out.println("<pre>"); try Statement stmt = con.createstatement(); ResultSet rs=stmt.executequery("select * from GuestBook"); while(rs.next()) out.println(" :") ; out.println(rs.getstring(1)); out.println(" :") ; out.println(rs.getstring(2)); out.println(" :") ; out.println(rs.getstring(3)); out.println(" :") ; out.println(rs.getstring(4));
223 12 Servlet 217 con.close(); out.println("</pre>"); con.close(); catch(sqlexception ex) while(ex!=null) out.println(" "); out.println(ex.getsqlstate()); out.println(ex.getmessage()); out.println(ex.geterrorcode()); ex=ex.getnextexception(); out.println("</body>"); out.println("</html>"); 12.9~ HTML VBScript
224 218 Java <script language="vbscript"> sub ok() if(trim(document.forms(0).elements(0).value)<>"" trim(document.forms(0).elements(1).value)<>"" trim(document.forms(0).elements(2).value)<>"" instr(document.forms(0).elements(2).value,"<")=0) then document.forms(0).submit else and and and
225 12 Servlet 219 end if end sub alert "!" document.forms(0).reset() </script> String =request.getparameter(" "); String content=request.getparameter("content"); java.util.date to_day = new java.util.date(); String date_string=to_day.tostring(); response.setcontenttype("text/html"); PrintWriter out = response.getwriter(); out.println("<html>"); out.println("<body>"); out.println("<head>"); if(name.length()==0 .length()==0 content.length()==0 content.length()>500) // out.println("<title> </title>"); out.println("</head>");
226 220 Java out.println("<body>"); out.println("<h1>,,!</h1>"); out.println("</body>"); out.println("</html>"); SQL Server Count Counter Vistit_time 12.14
227 12 Servlet import java.io.*; import java.text.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import java.net.url; import java.sql.*; public class Counter extends HttpServlet Connection con; public void init(servletconfig conf) throws ServletException super.init();// String l="jdbc:odbc:guestbook"; try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=drivermanager.getconnection(l,"sa",""); catch(exception e) // public void doget(httpservletrequest request, HttpServletResponse response) throws IOException, ServletException java.util.date to_day = new java.util.date();
228 222 Java String date_string=to_day.tostring(); response.setcontenttype("text/html"); PrintWriter out = response.getwriter(); out.println("<html>"); out.println("<body>"); out.println("<head>"); try Statement stmt = con.createstatement(); ResultSet rs=stmt.executequery("select Counter from Count"); int Count=rs.getInt(1); Count++; stmt.executeupdate("update Count values('" + Interger.toString(Count,10) + "',"'" + date_string + "')"); con.close(); out.println("<title> </title>"); out.println("</head>"); out.println("<body>"); out.println("<h1> " + Interger.toString(Count,10) + "!!</h1>"); catch(sqlexception ex) while(ex!=null) out.println(" "); out.println(ex.getsqlstate()); out.println(ex.getmessage()); out.println(ex.geterrorcode()); ex=ex.getnextexception(); out.println("</body>"); out.println("</html>");
229 12 Servlet Servlet JDBC 1 2 zhuanzhi employer Zhuanzhi: Area
230 224 Java 3 HTML <html> <head> <meta http-equiv="content-language" content="en-us"> <meta http-equiv="content-type" content="text/html; charset=gb2312"> <meta name="generator" content="microsoft FrontPage 4.0"> <meta name="progid" content="frontpage.editor.document"> <title>new Page 2</title> </head> <body> <div align="center"><center> <table width="75%" border="0"> <tr> <td width="28%"><img src="daxueshenghuo.jpg" width="156" height="60"> </td> <td width="72%"><img src="ad-baby.gif" width="468" height="60"></td> </tr> </table> <p> </p></center></div><div align="center"><center> <table border="0" cellpadding="0" cellspacing="0" width="50%"> <tr> <td width="100%"><p align="center"><font color="#000080">nksn </font></td> </tr> <tr> <td width="100%"><p align="center"><font color="#000080"> </font></td> </tr> </table> </center></div>
231 12 Servlet 225 <form method="post" action="zhaopin"> <div align="center"><center><p><font color="#000080"> <select size="1" name="major"> <option value="none" selected=true> </option> <option value="a"> </option> <option value="b"> </option> <option value="c"> </option> <option value="d"> </option> <option value="e"> </option> <option value="f"> </option> <option value="g"> </option> <option value="h"> </option> <option value="i"> </option> <option value="j"> </option> <option value="k"> </option> <option value="l"> </option> <option value="m"> </option> <option value="n"> </option> <option value="o"> </option> <option value="p"> </option> <option value="q"> </option> <option value="r"> </option> <option value="s"> </option> <option value="t"> </option> <option value="u"> </option> <option value="v"> </option> <option value="w"> </option> <option value="x"> </option> <option value="y"> </option> <option value="z"> </option> <option value="aa"> </option> <option value="ab"> </option> <option value="ac"> </option> <option value="ad"> </option> <option value="ae"> </option> <option value="af"> </option> <option value="ag"> </option> <option value="ah"> </option> <option value="ai"> </option> <option value="aj"> </option>
232 226 Java <option value="ak"> </option> <option value="al"> </option> <option value="am"> </option> <option value="an"> </option> <option value="ao"> </option> <option value="ap"> </option> <option value="aq"> </option> <option value="ar"> </option> </select> <select size="1" name="area"> <option value="none" selected=true> </option> <option value=1> </option> <option value=2> </option> <option value=3> </option> <option value=4> </option> <option value=5> </option> <option value=6> </option> <option value=7> </option> <option value=8> </option> <option value=9> </option> <option value=10> </option> <option value=11> </option> <option value=12> </option> <option value=13> </option> <option value=14> </option> <option value=15> </option> <option value=16> </option> <option value=17> </option> <option value=18> </option> <option value=19> </option> </select></font></p> </center></div><div align="center"><center><p><font color="#000080"><input type="submit" value=" " name="b1"></font></p> </center></div> </form> <p align="center"><font size="2" color="#ff0000"> </font></p>
233 12 Servlet 227 <p align="center"><font color="#000080"> NKWHT </font></p> <p align="center">(c) XXX<br> copyright Netcore Ltd.2000<br> <a </body> </html> <html> <head> <meta http-equiv="content-language" content="zh-cn"> <meta http-equiv="content-type" content="text/html; charset=gb2312"> <meta name="generator" content="microsoft FrontPage 4.0"> <meta name="progid" content="frontpage.editor.document"> <title>new Page 2</title> </head> <body bgcolor="#ffffff" text="#000080"> <div align="center"><center> <table width="75%" border="0"> <tr> <td width="27%"><img src="daxueshenghuo.jpg" width="156" height="60">
234 228 </td> Java <td width="73%"><img src="ad-baby.gif" width="468" height="60"></td> </tr> </table> <p> </p> </center></div> <p align="center"><big>nksn </big></p> <form method="post" action="search" name="shenqing"> <div align="center"><center><p> <select name="sex" size="1"> <option value="none"> </option> <option value="male"> </option> <option value="female"> </option> </select></p> </center></div><div align="center"><center><p> <select size="1" name="major"> <option value="none" selected=true> </option> <option value="1"> </option> <option value="2"> </option> <option value="3"> </option> <option value="4"> </option> <option value="5"> </option> <option value="6"> </option> <option value="7"> </option> <option value="8"> </option> <option value="9"> </option> <option value="10"> </option> <option value="11"> </option> <option value="12"> </option> <option value="13"> </option> <option value="14"> </option> <option value="15"> </option> <option value="16"> </option> <option value="17"> </option> <option value="18"> </option> <option value="19"> </option> <option value="20"> </option> <option value="21"> </option> <option value="22"> </option>
235 12 Servlet 229 <option value="23"> </option> <option value="24"> </option> <option value="25"> </option> <option value="26"> </option> <option value="27"> </option> <option value="28"> </option> <option value="29"> </option> <option value="30"> </option> <option value="31"> </option> <option value="32"> </option> <option value="33"> </option> <option value="34"> </option> <option value="35"> </option> <option value="36"> </option> <option value="37"> </option> <option value="38"> </option> <option value="39"> </option> <option value="40"> </option> <option value="41"> </option> <option value="42"> </option> <option value="43"> </option> <option value="44"> </option> </select></p> </center></div><div align="center"><center><p> <select size="1" name="yuanji"> <option value="none"> </option> <option value="1"> </option> <option value="2"> </option> <option value="3"> </option> <option value="4"> </option> <option value="5"> </option> <option value="6"> </option> <option value="7"> </option> <option value="8"> </option> <option value="9"> </option> <option value="10"> </option> <option value="11"> </option> <option value="12"> </option> <option value="13"> </option> <option value="14"> </option>
236 230 Java <option value="15"> </option> <option value="16"> </option> <option value="17"> </option> <option value="18"> </option> <option value="19"> </option> <option value="20"> </option> <option value="21"> </option> <option value="22"> </option> <option value="23"> </option> <option value="24"> </option> <option value="25"> </option> <option value="26"> </option> <option value="27"> </option> <option value="28"> </option> <option value="29"> </option> <option value="29"> </option> <option value="30"> </option> <option value="31"> </option> <option value="32"> </option> <option value="33"> </option> </select> / </p> </center></div><div align="center"><center> <p> <input type="submit" value=" " name="b1"> <input type="reset" value=" " name="b2"> </p> <p>made By NKWHT</p> <p>(c) XXX<br> copyright Netcore Ltd.2000<br> <a href="mailto:[email protected]">[email protected]</a></p> </center></div> </form> </body> </html> <html> <head>
237 12 Servlet <meta http-equiv="content-type" content="text/html; charset=gb2312"> <title> </title> <meta name="generator" content="microsoft FrontPage 4.0"> <meta name="microsoft Border" content="none"> </head> <body bgcolor="#f0fff0" text="#68a05f"> <div align="left"> <table border="0" cellpadding="0" cellspacing="0" width="97%"> <tr> <td width="16%"><img border="0" src="images/nksn.jpg" width="61" height="60"> </td> <td width="39%"><img border="0" src="images/netjob.gif" width="275" height="60"></td> <td width="2%"></td> <td width="48%"><img border="0" src="images/netliuxue.gif" width="273" height="60"></td> </tr> </table> </div> <p align="center"><big> </big></p>
238 232 Java <form method="post" action="inputzhaopin"> <div align="center"><center><p><input type="radio" value=" " name="r1"> <input type="radio" value=" " name="r2"> <input type="radio" value=" " name="r3"> <input type="radio" value=" " name="r4"> <input type="radio" value=" " name="r5"> </p> </center></div><div align="center"><center><p><input type="radio" value=" " name="r6"> <input type="radio" value=" " name="r7"> <input type="radio" value=" " name="r8"> <input type="radio" value=" " name="r9"> <input type="radio" value=" " name="r10"> </p> </center></div><div align="center"><center><p><input type="radio" value=" " name="r11"> <input type="radio" value=" " name="r12"> <input type="radio" value=" " name="r13"> <input type="radio" value=" " name="r14"> <input type="radio" value=" " name="r15"> <input type="radio" value=" " name="r16"> </p> </center></div><div align="center"><center><p><input type="radio" value=" " name="r17"> <input type="radio" value=" " name="r18"> <input type="radio" value=" " name="r19"> <input type="radio" value=" " name="r20"> <input type="radio" value=" " name="r21"> <input type="radio" value=" " name="r22"> </p> </center></div><div align="center"><center><p><input type="radio" value=" " name="r23"> <input type="radio" value=" " name="r24"> <input type="radio" value=" " name="r25"> <input type="radio" value=" " name="r26"> <input type="radio" value=" " name="r27"> <input type="radio" value=" " name="r28"> <input type="radio" value=" " name="r29"> </p> </center></div><div align="center"><center><p><input type="radio" value=" " name="r30"> <input type="radio" value=" " name="r31"> <input type="radio" value=" " name="r32"> <input type="radio" value=" " name="r33"> <input type="radio" value=" " name="r34"> </p> </center></div><div align="center"><center><p><input type="radio" value=" " name="r35"> <input type="radio" value=" " name="r36"> <input type="radio" value=" " name="r37"> <input type="radio"
239 12 Servlet 233 value=" " name="r38"> <input type="radio" value=" " name="r39"> </p> </center></div><div align="center"><center><p><input type="radio" value=" " name="r40"> <input type="radio" value=" " name="r41"> <input type="radio" value=" " name="r42"> <input type="radio" value=" " name="r43"> <input type="radio" value=" " name="r44"> </p> </center></div><div align="center"><center><p> <select name="area" size="1"> <option value="1"> </option> <option value="2"> </option> <option value="3"> </option> <option value="4"> </option> <option value="5"> </option> <option value="6"> </option> <option value="7"> </option> <option value="8"> </option> <option value="9"> </option> <option value="10"> </option> <option value="11"> </option> <option value="12"> </option> <option value="13"> </option> <option value="14"> </option> <option value="15"> </option> <option value="16"> </option> <option value="17"> </option> <option value="18"> </option> <option value="19"> </option> </select> <input type="text" name="company" size="30"></p> </center></div><div align="center"><center><p> </p> </center></div><div align="center"><center><p><textarea rows="5" name="content" cols="26"></textarea></p> </center></div><div align="center"><center><p><input type="submit" value=" " name="b1"><input type="reset" value=" " name="b2"></p> </center></div> </form> </body> </html> 12.18
240 234 Java <html> <head> <meta http-equiv="content-language" content="zh-cn"> <meta http-equiv="content-type" content="text/html; charset=gb2312"> <meta name="generator" content="microsoft FrontPage 4.0"> <meta name="progid" content="frontpage.editor.document"> <title>new Page 2</title> </head> <script language="vbscript"> sub ok() if(trim(document.forms(0).elements(0).value)<>"" trim(document.forms(0).elements(1).value)<>"" trim(document.forms(0).elements(2).value)<>"" trim(document.forms(0).elements(6).value)<>"" trim(document.forms(0).elements(7).value)<>"" trim(document.forms(0).elements(8).value)<>"" trim(document.forms(0).elements(9).value)<>"" trim(document.forms(0).elements(11).value)<>"" instr(document.forms(0).elements(11).value,"<")=0) then document.forms(0).submit() and and and and and and and and
241 12 Servlet 235 else end if end sub alert "!" </script> <body bgcolor="#ffffff" text="#000080"> <div align="center"><center> <table width="75%" border="0"> <tr> <td width="28%"><img src="daxueshenghuo.jpg" width="156" height="60"> </td> <td width="72%"><img src="ad-baby.gif" width="468" height="60"></td> </tr> </table> <p> </p> </center> </div> <p align="center"><big>nksn </big></p> <form method="post" action="zhuche " name="shenqing"> <div align="center"><center> <p> <input type="text" name="zhanghao" size="10"> <input type="password" name="mima" size="10"> </p> </center> </div> <div align="center"></div> <div align="center"><center> <p> <input type="text" name="name" size="10">
242 236 Java <input type="radio" value="male" checked name="male"> <input type="radio" name="male" value="female"> </p> </center> </div> <div align="center"> <center> </center></div><div align="center"><center> <p> <select size="1" name="major"> <option value="1"> </option> <option value="2"> </option> <option value="3"> </option> <option value="4"> </option> <option value="5"> </option> <option value="6"> </option> <option value="7"> </option> <option value="8"> </option> <option value="9"> </option> <option value="10"> </option> <option value="11"> </option> <option value="12"> </option> <option value="13"> </option> <option value="14"> </option> <option value="15"> </option> <option value="16"> </option> <option value="17"> </option> <option value="18"> </option> <option value="19"> </option> <option value="20"> </option> <option value="21"> </option> <option value="22"> </option> <option value="23"> </option> <option value="24"> </option> <option value="25"> </option> <option value="26"> </option>
243 12 Servlet 237 <option value="27"> </option> <option value="28"> </option> <option value="29"> </option> <option value="30"> </option> <option value="31"> </option> <option value="32"> </option> <option value="33"> </option> <option value="34"> </option> <option value="35"> </option> <option value="36"> </option> <option value="37"> </option> <option value="38"> </option> <option value="39"> </option> <option value="40"> </option> <option value="41"> </option> <option value="42"> </option> <option value="43"> </option> <option value="44"> </option> </select> <input type="text" name="lou" size="2"> <input type="text" name="room" size="3"> </p> </center> </div> <div align="center"> <center> </center></div><div align="center"><center> <p> <input type="text" name="tel" size="15"> <input type="text" name="mail" size="30"> </p> </center> </div> <div align="center">
244 238 Java <center> </center></div><div align="center"><center><p> <select size="1" name="yuanji"> <option value="1"> </option> <option value="2"> </option> <option value="3"> </option> <option value="4"> </option> <option value="5"> </option> <option value="6"> </option> <option value="7"> </option> <option value="8"> </option> <option value="9"> </option> <option value="10"> </option> <option value="11"> </option> <option value="12"> </option> <option value="13"> </option> <option value="14"> </option> <option value="15"> </option> <option value="16"> </option> <option value="17"> </option> <option value="18"> </option> <option value="19"> </option> <option value="20"> </option> <option value="21"> </option> <option value="22"> </option> <option value="23"> </option> <option value="24"> </option> <option value="25"> </option> <option value="26"> </option> <option value="27"> </option> <option value="28"> </option> <option value="29"> </option> <option value="29"> </option> <option value="30"> </option> <option value="31"> </option> <option value="32"> </option> <option value="33"> </option> </select> / </p> </center></div><div align="center"><center><p> (<font color="#ff0000"> <small> HTML</small></font>)</p>
245 12 Servlet 239 </center></div><div align="center"><center><p><textarea rows="11" name="jianjie" cols="47"></textarea></p> </center></div><div align="center"><center> <p> <input type="button" value=" " name="su" onclick="ok()"> <input type="reset" value=" " name="res"> </p> <p>(c) XXXX<br> copyright Netcore Ltd.2000<br> <a </center></div> </form> </body> </html> <html> <head> <meta http-equiv="content-language" content="en-us"> <meta http-equiv="content-type" content="text/html; charset=gb2312">
246 240 Java <meta name="generator" content="microsoft FrontPage 4.0"> <meta name="progid" content="frontpage.editor.document"> <title>new Page 1</title> </head> <script language="javascript"> function ok() if(document.forms(0).elements(0).value!="" document.forms(0).elements(1). value!="") document.forms(0).submit(); && else alert("!"); document.forms(0).reset(); </script> <body bgcolor="#ffffff"> <div align="center"><center> <table width="75%" border="0"> <tr> <td width="28%"><img src="daxueshenghuo.jpg" width="156" height="60"> </td> <td width="72%"><img src="ad-baby.gif" width="468" height="60"></td> </tr> </table> <p> </p> </center></div> <p align="center"><font color="#000080"><big><big> </big></big></font></p> <form method="post" action="edit.asp"> <div align="center"><center><p><font color="#000080"> <input type="text" name="name" size="10"></font></p> </center></div><div align="center"><center><p><font color="#000080"> <input type="text" name="zhanghao" size="10"></font></p> </center></div><div align="center"><center><p><font color="#000080"> <input type="password" name="mima" size="10"></font></p>
247 12 Servlet 241 </center></div><div align="center"><center><p><input type="button" value=" " name="b1" onclick="ok()"><input type="reset" value=" " name="b2"></p> </center></div> <p align="center">made By NKWHT</p> <p align="center">(c) XXXXX<br> copyright Netcore Ltd.2000<br> <a </p> </form> </body> </html> Servlet zhuce.java import java.io.*; import java.text.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import java.net.url; import java.sql.*; public class GuestBook extends HttpServlet
248 242 Java Connection con; public void init(servletconfig conf) throws ServletException super.init();// String l="jdbc:odbc:employer"; try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=drivermanager.getconnection(l,"sa",""); catch(exception e) // public void doget(httpservletrequest request, HttpServletResponse response) throws IOException, ServletException // String zhanghao=string.(request.getparameter("zhanghao")); String mima=string.(request.getparameter("mima")); String name=string.(request.getparameter("name")); String jianjie= request.getparameter("jianjie"); String major=request.getparameter("major") ; String sex=request.getparameter("male"); String building=string.(request.getparameter("lou")); String room=string.(request.getparameter("room")); String tel=string.(request.getparameter("tel")); String mail=string.(request.getparameter("mail")); String yuanji=string.(request.getparameter("yuanji")); PrintWriter out = response.getwriter(); out.println("<html>"); out.println("<body>"); out.println("<head>"); if( name!="" && major!="" && building!="" && mail!="" && room!="" && tel!="" && zhanghao!="" && mima!="" && jianjie.indexof("<")==0) //, // try
249 12 Servlet 243 Statement stmt = con.createstatement(); String sql="insert Employer values(zhanghao,mima, major,sex,building,room,tel,mail,yuanji)"; stmt.executeupdate(sql); con.close(); response.setcontenttype("text/html"); out.println("<title> </title>"); out.println("</head>"); out.println("<body>"); out.println("<h1>!!</h1>"); catch(sqlexception ex) while(ex!=null) out.println(" "); out.println(ex.getsqlstate()); out.println(ex.getmessage()); out.println(ex.geterrorcode()); ex=ex.getnextexception(); else //, out.println("<title> </title>"); out.println("</head>"); out.println("<body>"); out.println("<h1>,,!</h1>"); out.println("</body>"); out.println("</html>"); return ; out.println("</body>"); out.println("</html>"); 12.21( ) 12.22
250 244 Java zhaopin.java import java.io.*; import java.text.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import java.net.url; import java.sql.*;
251 12 Servlet 245 public class GuestBook extends HttpServlet Connection con; public void init(servletconfig conf) throws ServletException super.init();// String l="jdbc:odbc:employer"; try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=drivermanager.getconnection(l,"sa",""); catch(exception e) // public void doget(httpservletrequest request, HttpServletResponse response) throws IOException, ServletException String major=request.getparameter("major") String add=request.getparameter("area") String sql; if (major=="none" && add=="none" ) sql=="select number,area from zhuanzhi" else if (major=="none" && add!=="none") sql=="select number,area from zhuanzhi where area==" & add else if (major!=="none" && add!=="none" ) sql=="select number,area from zhuanzhi where area==" & add & "&& " & major & "==true" else if (major!=="none" && add=="none" ) sql=="select number,area from zhuanzhi where " & major & "==True" response.setcontenttype("text/html"); PrintWriter out = response.getwriter(); out.println("<html>"); out.println("<body>"); out.println("<head>"); out.println("p align="center"> </p>");
252 246 Java // html try Statement stmt = con.createstatement(); ResultSet res=stmt.executequery(sql); if(!res.eof()) // String table_string="<table border='1' width='100%'> <tr> <td width='15%' align='center'> </td> <td width='58%' align='center'> </td> <td width='27%' align='center'> </td> </tr> </table>" out.println(table_string); // while(res.getnext()) // table_string="<table border='1' width='100%'> <tr> <td width='15%' align='center'> <a href='zhaopinresult?mode=" + res.getstring("number") +"'>" + res.getstring("number") + "</a></td> <td width='58%' align='center'>" + res.getstring("company") + "</td> <td width='27%' align='center'>" + res.getstring("area") + "</td></tr> </table>"; out.println(table_string); else out.println("<p align=center><font color=red>,!</font></p>"); catch(sqlexception ex) while(ex!=null)
253 12 Servlet 247 out.println(" "); out.println(ex.getsqlstate()); out.println(ex.getmessage()); out.println(ex.geterrorcode()); ex=ex.getnextexception(); out.println("</body>"); out.println("</html>");
254 248 Java zhaopinresult.java import java.io.*; import java.text.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import java.net.url; import java.sql.*; public class GuestBook extends HttpServlet Connection con; public void init(servletconfig conf) throws ServletException super.init();// String l="jdbc:odbc:employer"; try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=drivermanager.getconnection(l,"sa",""); catch(exception e) // public void doget(httpservletrequest request, HttpServletResponse response) throws IOException, ServletException String key=request.getparameter("mode"); // String sql="select * from employer where number='" + key + "'"; response.setcontenttype("text/html"); PrintWriter out = response.getwriter(); out.println("<html>"); out.println("<body>"); out.println("<head>"); out.println("p align="center"> </p>"); // html try
255 12 Servlet 249 Statement stmt = con.createstatement(); ResultSet res=stmt.executequery(sql); if(!res.eof()) // String table_string="<p align="center"><font size="4" color="#679966"> </font></p>" // out.println(table_string); // table_string=<p align='center'> </p> <div align='center'><center> <table border='1' width='84%'> <tr> <td width='100%'><p align='center'>" +res.getparameter("content") + "</td> </tr> </table> </center></div>"; out.println(table_string); else out.println("<p align=center><font color=red>,!</font></p>"); catch(sqlexception ex) while(ex!=null) out.println(" "); out.println(ex.getsqlstate()); out.println(ex.getmessage()); out.println(ex.geterrorcode()); ex=ex.getnextexception(); table_string="<p align='center'> <a href='javascript:void(0)' onclick='window.history.back()'> </a> 
256 250 Java <a href='zhaopin.htm'> </a></p>" ; out.println(table_string); out.println("</body>"); out.println("</html>"); search.java import java.io.*; import java.text.*; import java.util.*;
257 12 Servlet 251 import javax.servlet.*; import javax.servlet.http.*; import java.net.url; import java.sql.*; public class Search extends HttpServlet Connection con; public void init(servletconfig conf) throws ServletException super.init();// String l="jdbc:odbc:employer"; try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=drivermanager.getconnection(l,"sa",""); catch(exception e) // public void doget(httpservletrequest request, HttpServletResponse response) throws IOException, ServletException String major=request.getparameter("major") String sex=request.getparameter("sex"); String yuanji=request.getparameter("yuanji"); String sql="select zhanghao,major,sex from employer"; if ( sex!="none" and major!="none" and yuanji!="none" ) sql="select zhanghao,sex,major from employer where major=" & major & "and sex='" & sex & "' and yuanji=" & yuanji ; else if ( major!="none" and sex="none" and yuanji!="none" ) sql="select zhanghao,sex,major from employer where major=" & major & "and yuanji=" & yuanji ; else if ( major="none" and sex!="none" and yuanji="none" ) sql="select zhanghao,sex,major from employer where sex='" & sex & "'"; else if ( major="none" and sex="none" and yuanji!="none" )
258 252 Java sql="select zhanghao,sex,major from employer where yuanji=" & yuanji; else if ( major="none" and sex!="none" and yuanji!="none" ) sql="select zhanghao,sex,major from employer where sex='" & sex & "'and yuanji=" & yuanji; else if ( major!="none" and sex!="none" and yuanji="none" ) sql="select zhanghao,sex,major from employer where major=" & major & " and sex='" & sex & "'"; else if ( major!="none" and sex="none" and yuanji="none" ) sql="select zhanghao,sex,major from employer where major=" & major ; else if ( major="none" and sex!="none" and yuanji="none" ) sql="select zhanghao,sex,major from employer where sex='" & sex & "'"; response.setcontenttype("text/html"); PrintWriter out = response.getwriter(); out.println("<html>"); out.println("<body>"); out.println("<head>"); out.println("p align="center"> </p>"); // html try Statement stmt = con.createstatement(); ResultSet res=stmt.executequery(sql); if ((!res.eof()) // while(res.getnext()) // table_string="<table border='1' width='100%'> <tr> <td width='15%' align='center'> <a href='result?mode=" + res.getstring("zhanghao") +"'>" + res.getstring("sex") + "</a></td> <td width='58%' align='center'>" + res.getstring("major") + "</td> <td width='27%' align='center'>" + res.getstring("area") +
259 12 Servlet 253 "</td></tr> </table>"; out.println(table_string); else out.println("<p align=center><font color=red>,!</font></p>"); catch(sqlexception ex) while(ex!=null) out.println(" "); out.println(ex.getsqlstate()); out.println(ex.getmessage()); out.println(ex.geterrorcode()); ex=ex.getnextexception(); out.println("</body>"); out.println("</html>");
260 254 Java result.java import java.io.*; import java.text.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import java.net.url; import java.sql.*; public class Result extends HttpServlet Connection con; public void init(servletconfig conf) throws ServletException super.init();// String l="jdbc:odbc:employer"; try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=drivermanager.getconnection(l,"sa",""); catch(exception e) // public void doget(httpservletrequest request, HttpServletResponse response) throws IOException, ServletException String key=request.getparameter("key");
261 12 Servlet 255 String sql="select * from employer where zhanghao='" & key & "'"; response.setcontenttype("text/html"); PrintWriter out = response.getwriter(); out.println("<html>"); out.println("<body>"); out.println("<head>"); out.println("p align="center"> </p>"); // html try Statement stmt = con.createstatement(); ResultSet res=stmt.executequery(sql); if ((!res.eof()) // String name=res.getstring("name"); // String sex=res.getstring("sex"); // String major=res.getstring("major"); // String tel=res.getstring("tel"); // String mail=res.getstring("mail"); // String builder=res.getstring("building"); // String room=res.getstring("room"); // String yuanji=res.getstring("yuanji"); // String jianjie=res.getstring("jianjie"); // String table_string=/* */ "<div align='center'><center> <table width='75%' border='0'> <tr> <td width='28%'><img src='daxueshenghuo.jpg' width='156' height='60'></td> <td width='72%'><img src='ad-baby.gif' width='468' height='60'></td>
262 256 Java </tr> </table> <p> </p> </center> </div> <p align='center'><font size='4' color='#679966'> </font></p> <table border='1' width='100%'> <tr> <td width='33%' align='center'><p align='center'> </td> <td width='33%' align='center'> </td> <td width='34%' align='center'> </td> </tr> <tr> <td width='33%' align='center'>"+name+" </td> <td width='33%' align='center'>"+sex+" </td> <td width='34%' align='center'>"+major+" </td> </tr> </table> <table border='1' width='100%'> <tr> <td width='50%' align='center'> </td> <td width='50%' align='center'> </td> </tr> <tr> <td width='50%' align='center'>"+res('tel')+" </td> <td width='50%' align='center'>"+res('mail')+" </td> </tr> <tr> <td width='50%' align='center'> </td> <td width='50%' align='center'> </td> </tr> <tr>
263 12 Servlet 257 <td width='50%' align='center'>"+building+" "+' '+" "+room+" </td> <td width='50%' align='center'>"+yuanji+" </td> </tr> </table> <p align='center'> </p> <div align='center'><center> <table border='1' width='84%'> <tr> <td width='100%'><p align='center'>"+jianjie+"</td> </tr> </table> </center></div>"; out.println(table_string); else out.println("<p align=center><font color=red>,!</font></p>"); catch(sqlexception ex) while(ex!=null) out.println(" "); out.println(ex.getsqlstate()); out.println(ex.getmessage()); out.println(ex.geterrorcode()); ex=ex.getnextexception(); out.println("</body>"); out.println("</html>");
264 258 Java masterinput.java import java.io.*; import java.text.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import java.net.url; import java.sql.*; public class Result extends HttpServlet Connection con; public void init(servletconfig conf) throws ServletException
265 12 Servlet 259 super.init();// String l="jdbc:odbc:employer"; try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=drivermanager.getconnection(l,"sa",""); catch(exception e) // public void doget(httpservletrequest request, HttpServletResponse response) throws IOException, ServletException response.setcontenttype("text/html"); PrintWriter out = response.getwriter(); out.println("<html>"); out.println("<body>"); out.println("<head>"); out.println("p align="center"> </p>"); // html try Statement stmt = con.createstatement(); bool res[44]; // true if request.getparameter("r1")!="" res[0)=true; else res[0)=false; if request.getparameter("r2")!="" res[1)=true; else res[1)=false; if request.getparameter("r3")!="" res[2)=true; else res[2)=false;
266 260 Java if request.getparameter("r4")!="" res[3)=true; else res[3)=false; if request.getparameter("r5")!="" res[4)=true; else res[4)=false; if request.getparameter("r6")!="" res[5)=true; else res[5)=false; if request.getparameter("r7")!="" res[6)=true; else res[6)=false; if request.getparameter("r8")!="" res[7)=true; else res[7)=false; if request.getparameter("r9")!="" res[8)=true; else res[8)=false; if request.getparameter("r10")!="" res[9)=true; else res[9)=false; if request.getparameter("r11")!="" res[10)=true; else res[10)=false;
267 12 Servlet 261 if request.getparameter("r12")!="" res[11)=true; else res[11)=false; if request.getparameter("r13")!="" res[12)=true; else res[12)=false; if request.getparameter("r14")!="" res[13)=true; else res[13)=false; if request.getparameter("r15")!="" res[14)=true; else res[14)=false; if request.getparameter("r16")!="" res[15)=true; else res[15)=false; if request.getparameter("r17")!="" res[16)=true; else res[16)=false; if request.getparameter("r18")!="" res[17)=true; else res[17)=false; if request.getparameter("r19")!="" res[18)=true; else res[18)=false; if request.getparameter("r20")!=""
268 262 Java else res[19)=true; res[19)=false; if request.getparameter("r21")!="" res[20)=true; else res[20)=false; if request.getparameter("r22")!="" res[21)=true; else res[21)=false; if request.getparameter("r23")!="" res[22)=true; else res[22)=false; if request.getparameter("r24")!="" res[23)=true; else res[23)=false; if request.getparameter("r25")!="" res[24)=true; else res[24)=false; if request.getparameter("r26")!="" res[25)=true; else res[25)=false; if request.getparameter("r27")!="" res[26)=true; else res[26)=false; if request.getparameter("r28")!=""
269 12 Servlet 263 else res[27)=true; res[27)=false; if request.getparameter("r29")!="" res[28)=true; else res[28)=false; if request.getparameter("r30")!="" res[29)=true; else res[29)=false; if request.getparameter("r31")!="" res[30)=true; else res[30)=false; if request.getparameter("r32")!="" res[31)=true; else res[31)=false; if request.getparameter("r33")!="" res[32)=true; else res[32)=false; if request.getparameter("r34")!="" res[33)=true; else res[33)=false; if request.getparameter("r35")!="" res[34)=true; else res[34)=false; if request.getparameter("r36")!="" res[35)=true;
270 264 Java else res[35)=false; if request.getparameter("r37")!="" res[36)=true; else res[36)=false; if request.getparameter("r38")!="" res[37)=true; else res[37)=false; if request.getparameter("r39")!="" res[38)=true; else res[38)=false; if request.getparameter("r40")!="" res[39)=true; else res[39)=false; if request.getparameter("r41")!="" res[40)=true; else res[40)=false; if request.getparameter("r42")!="" res[41)=true; else res[41)=false; if request.getparameter("r43")!="" res[42)=true; else res[42)=false; if request.getparameter("r44")!="" res[43)=true;
271 12 Servlet 265 else res[43)=false; String company=request.getparameter("company"); // String area=request.getparameter("area"); // String sql="insert zhaopin values("; for(int i=0;i<44;i++) sql+=res[i] + ","; // sql+="'"+ company+ "','" + area + "')"; // sql, stmt.executeupdate(sql); out.println("<p align=center><font color=red>!</font></p>"); catch(sqlexception ex) while(ex!=null) out.println(" "); out.println(ex.getsqlstate()); out.println(ex.getmessage()); out.println(ex.geterrorcode()); ex=ex.getnextexception(); out.println("</body>"); out.println("</html>"); edit.java import java.io.*; import java.text.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import java.net.url;
272 266 Java import java.sql.*; public class Edit extends HttpServlet Connection con; public void init(servletconfig conf) throws ServletException super.init();// String l="jdbc:odbc:employer"; try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=drivermanager.getconnection(l,"sa",""); catch(exception e) // public void doget(httpservletrequest request, HttpServletResponse response) throws IOException, ServletException String name=request.getparameter("name"); // String password=request.getparameter("mima"); // String sql="select password from employer where zhanghao='" & name & "'"; response.setcontenttype("text/html"); PrintWriter out = response.getwriter();
273 12 Servlet 267 out.println("<html>"); out.println("<body>"); out.println("<head>"); out.println("p align="center"> </p>"); // html try Statement stmt = con.createstatement(); ResultSet res=stmt.executequery(sql); if ((!res.eof()) // String pass=res.getstring("pass"); if(password==pass) out.println("<h1>,!</h1>"); else out.println("<p align=center><font color=red>,!</font> </p>"); else out.println("<p align=center><font color=red>,!</font></p>"); catch(sqlexception ex) while(ex!=null) out.println(" "); out.println(ex.getsqlstate()); out.println(ex.getmessage()); out.println(ex.geterrorcode()); ex=ex.getnextexception(); out.println("</body>"); out.println("</html>"); 12.32~ 12.34
274 268 Java editmore.java import java.io.*; import java.text.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*;
275 12 Servlet 269 import java.net.url; import java.sql.*; public class EditMore extends HttpServlet Connection con; public void init(servletconfig conf) throws ServletException super.init();// String l="jdbc:odbc:employer"; try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=drivermanager.getconnection(l,"sa",""); catch(exception e) // public void doget(httpservletrequest request, HttpServletResponse response) throws IOException, ServletException String mode=request.getparameter("mode"); String sql="select * from employer where zhangha='" + mode + "'"; response.setcontenttype("text/html"); PrintWriter out = response.getwriter(); out.println("<html>"); out.println("<body>"); out.println("<head>"); out.println("p align="center"> </p>"); // html try Statement stmt = con.createstatement(); ResultSet res=stmt.executequery(sql); // String mima=res.getstring("password"); // String lou=res.getstring("building");
276 270 Java String room=res.getstring("room"); String tel=res.getstring("tel"); String mail=res.getstring("mail"); String jianjie=res.getstring("jianjie"); res.close(); // String table_string=/* */ "<body bgcolor='#ffffff' text='#000080'> <div align='center'><center> <table width='75%' border='0'> <tr> <td width='28%'> <img src='daxueshenghuo.jpg' width='156' height='60'> </td> <td width='72%'> <img src='ad-baby.gif' width='468' height='60'> </td> </tr> </table> </center></div> <form method='post' action='editover' name='shenqing'> <div align='center'> <center><p> <input type='password' name='mima' size='10' value='"+mima+"'> </p> </center></div> <div align='center'> <center><p> <input type='text' name='name' size='10' value='"+name+"'></p> </center></div> <div align='center'> <center><p> <input type='text' name='lou' size='2' value='"+lou+"'> <input type='text' name='room' size='3' value='"+room+"'> </p>
277 12 Servlet 271 </center></div> <div align='center'> <center><p> <input type='text' name='tel' size='15' value='"+tel+"'></p> </center></div> <div align='center'><center><p> <input type='text' name='mail' size='30' value='"+mail+"'></p> </center></div> <div align='center'><center> <p> </p> </center></div> <div align='center'> <center><p><textarea rows='11' name='jianjie' cols='47'>"+jianjie+"</textarea></p> </center></div> <div align='center'><center> <p> <input type='submit' value=' '> <input type='reset' value=' '> </p> <p>(c) XXXXXXX<br> copyright Netcore Ltd.2000<br> <a </center></div> </form>" out.println(table_string); catch(sqlexception ex) while(ex!=null) out.println(" "); out.println(ex.getsqlstate()); out.println(ex.getmessage()); out.println(ex.geterrorcode()); ex=ex.getnextexception();
278 272 Java out.println("</body>"); out.println("</html>"); editover.java import java.io.*; import java.text.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import java.net.url; import java.sql.*; public class EditOver extends HttpServlet Connection con; public void init(servletconfig conf) throws ServletException super.init();// String l="jdbc:odbc:employer"; try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=drivermanager.getconnection(l,"sa",""); catch(exception e)
279 12 Servlet 273 // public void doget(httpservletrequest request, HttpServletResponse response) throws IOException, ServletException String jianjie=request.getparameter("jianjie"); String password=request.getparameter("mima"); String name=request.getparameter("name") ; String building=request.getparameter("lou"); String room=request.getparameter("room"); String tel=request.getparameter("tel"); String mail=request.getparameter("mail"); response.setcontenttype("text/html"); PrintWriter out = response.getwriter(); out.println("<html>"); out.println("<body>"); out.println("<head>"); out.println("p align="center"> </p>"); // html if( name!=""&& building!="" && mail!="" && room!="" && tel!="" && password!="" && jianjie!="" ) String sql="update employer set values(name='" + name"',building='" +building + "',mail='" + mail + "',room='" + room + "', tel='" + tel + "',password='" + mima + "')"; // sql try Statement stmt = con.createstatement(); stmt.executeupdate(sql); out.println("<h1>!</h1>"); else out.println("<p align=center><font color=red>,!</font></p>"); catch(sqlexception ex)
280 274 Java while(ex!=null) out.println(" "); out.println(ex.getsqlstate()); out.println(ex.getmessage()); out.println(ex.geterrorcode()); ex=ex.getnextexception(); out.println("</body>"); out.println("</html>"); Servlet JDBC
281 12 Servlet IMG HTML 3 SQL JDBC 4
282 13 Java Server Pages Servlet JSP HTML 13.1 JSP JDBC Servlet Java Java Sun JSP 1 JSP JSP Java Java Java Web Java Servlet JSP Java Web Java Java Java Jsp Servlet Java Java Web Java Bean EJB Java Application Server Java 2 JSP JSP JSP Java Java HTTPServlet <jsp:* <%@ URL JavaBean JSP Java Servlet Servlet JSP Java Servlet JSP Java Servlet Code(.java ) Java Runtime Bin Code(.class ) JSP CPU JSP Java Java class JSP class Java JSP ASP JSP
283 13 Java Server Pages JSP (1) java php (2) Java servlet/jsp Web Server/Application Server... Asp/php (3) Jar Servlet/JSP Application... Java (4) Asp Java 4 JSP JSP (1) ASP Java Java jre jdk jsdk jswdk... (2) JSP (3) Java class.java.class 13.2 JSP JSP Java Java Java JSP JSP HTML TAG TAG <% %> JSP "Thanks for ordering Core Web Programming"
284 278 Java Thanks for ordering <I><%= request.getparameter("title") %></I>.jsp Servlet Servlet servlet web HTML Servlet JSP HTML JSP Servlet Java Servlet BEAN JSP JSP JSP JSP JSP JSP <%= %> JSP <% %> service JSP <%! %> Servlet service JSP page att="val" %> SERVLET JSP include include file="url" %> Servlet JSP <%-- --%> JSP SERVLET jsp:include <jsp:include page="relative URL"flush="true"/> jsp:usebean <jsp:usebean att=val*/> or <jsp:usebean att=val*>... </jsp:usebean> Java BEAN jsp:setproperty <jsp:setproperty att=val*/> bean jsp:getproperty jsp:forward jsp:plugin JSP <jsp:getproperty name="propertyname" value="val"/> <jsp:forward page="relative URL"/> <jsp:plugin attribute="value"*>... </jsp:plugin> bean OBJECT, APPLET PLUGIN JSP Java JSP Servlet <%= %> <% %> Servlet <%! %> Servlet
285 13 Java Server Pages Java <%= Java %> Java / : <%= new java.util.date() %> JSP request, the HttpServletRequest; response, the HttpServletResponse; session, the HttpSession associated with the request (if any); and out, the PrintWriter (a buffered version of type JspWriter) <%= request.getremotehost() %> 13.2 XML <jsp:expression> Java </jsp:expression> XML 2 JSP Scriptlets scriptlets Java Servlet <% %>
286 280 Java 13.2 scriptlets out <% String querydata = request.getquerystring(); out.println("attached GET data: " + querydata); %> Servlet Java <% if (Math.random() < 0.5) %> Have a <B>nice</B> day! <% else %> Have a <B>lousy</B> day! <% %> if (Math.random() < 0.5) out.println("have a <B>nice</B> day!"); else out.println("have a <B>lousy</B> day!"); %> %\> XML <% %> <jsp:scriptlet>
287 13 Java Server Pages 281 </jsp:scriptlet> 13.3 JSP JSP JSP Servlet <%! %> JSP JSP JSP SERVLET <%! private int accesscount = 0; %> Accesses to page since server reboot: <%= ++accesscount %> JSP %> %\> XML <jsp:declaration> Code </jsp:declaration> JSP JSP Servlet <%@ directive attribute="value" %> <%@ directive attribute1="value1" attribute2="value2" attributen="valuen" %>
288 282 Java JSP page, Servlet include Servlet JSP1.1 JSP1.1 (1) JSP page page import="package.class" or import="package.class1,...,package.classn" <%@ page import="java.util.*" %> import contenttype="mime-type" or contenttype="mime-type; charset=character-set" MIME text/html <%@ page contenttype="text/plain" %> <% response.setcontenttype("text/plain"); %> isthreadsafe="true false". true ( ) Servlet false SERVLET SingleThreadModel, session="true false". true ( ) session (of type HttpSession) Session false session, session JSP SERVLET buffer="sizekb none" JspWriter out 8KB autoflush="true false". true false buffer="none" extends="package.class". Servlet
289 13 Java Server Pages 283 info="message" getservletinfo errorpage="url" iserrorpage="true false". false. language="java". Java XML <jsp:directive.directivetype attribute=value /> page import="java.util.*" %> XML <jsp:directive.page import="java.util.*" /> (2) JSP include Include JSP Servlet include file="relative url" %> JSP Include JSP FRAME TABLE Include <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>Servlet Tutorial: JavaServer Pages (JSP) 1.0</TITLE> <META NAME="author" <META NAME="keywords" CONTENT="..."> <META NAME="description" CONTENT="..."> <LINK REL=STYLESHEET HREF="Site-Styles.css" TYPE="text/css"> </HEAD> <BODY> include file="/navbar.html" %> <!-- Part specific to this page... --> </BODY> </HTML> Include JSP Include ACTION jsp:include
290 284 Java ASP JSP ASP JSP JSP <HTML> <HEAD> <TITLE>Using JavaServer Pages</TITLE> <META NAME="author" CONTENT="Marty Hall -- <META NAME="keywords" CONTENT="JSP,JavaServer Pages,servlets"> <META NAME="description" CONTENT="A quick example of the four main JSP tags."> <LINK REL=STYLESHEET HREF="My-Style-Sheet.css" TYPE="text/css"> </HEAD> <BODY BGCOLOR="#FDF5E6" TEXT="#000000" LINK="#0000EE" VLINK="#551A8B" ALINK="#FF0000"> <CENTER> <TABLE BORDER=5 BGCOLOR="#EF8429"> <TR><TH CLASS="TITLE"> Using JavaServer Pages</TABLE> </CENTER> <P> Some dynamic content created using various JSP mechanisms: <UL> <LI><B>Expression.</B><BR> Your hostname: <%= request.getremotehost() %>. <LI><B>Scriptlet.</B><BR> <% out.println("attached GET data: " + request.getquerystring()); %> <LI><B>Declaration (plus expression).</b><br> <%! private int accesscount = 0; %> Accesses to page since server reboot: <%= ++accesscount %> <LI><B>Directive (plus expression).</b><br> <%@ page import = "java.util.*" %> Current date: <%= new Date() %>
291 13 Java Server Pages 285 </UL> </BODY> </HTML> JSP XML Servlet Java Bean Java HTML PLUGIN jsp:include jsp:usebean JavaBean jsp:setproperty JavaBean jsp:getproperty Java Bean jsp:forward jsp:plugin (1) jsp:include <jsp:include page="relative URL" flush="true" /> include directive, Servlet, Servlet JSP JSP 4 What's New?
292 286 Java <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>What's New</TITLE> <LINK REL=STYLESHEET HREF="My-Style-Sheet.css" TYPE="text/css"> </HEAD> <BODY BGCOLOR="#FDF5E6" TEXT="#000000" LINK="#0000EE" VLINK="#551A8B" ALINK="#FF0000"> <CENTER> <TABLE BORDER=5 BGCOLOR="#EF8429"> <TR><TH CLASS="TITLE"> What's New at JspNews.com</TABLE> </CENTER> <P> Here is a summary of our four most recent news stories: <OL> <LI><jsp:include page="item1.html" flush="true"/> <LI><jsp:include page="item2.html" flush="true"/> <LI><jsp:include page="item3.html" flush="true"/> <LI><jsp:include page="item4.html" flush="true"/> </OL> </BODY> </HTML> (2) jsp:usebean JavaBean Java bean <jsp:usebean id="name" class="package.class" /> class id scope Bean Bean usebean id scope Bean jsp:setproperty scriptlet id Bean foo x getfoo
293 13 Java Server Pages 287 x setfoo jsp:setproperty getxxx jsp:getproperty Bean Java Web Server Bean jar servlets Bean / BeanTest.jsp <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>Reusing JavaBeans in JSP</TITLE> <LINK REL=STYLESHEET HREF="My-Style-Sheet.css" TYPE="text/css"> </HEAD> <BODY> <CENTER> <TABLE BORDER=5> <TR><TH CLASS="TITLE"> Reusing JavaBeans in JSP</TABLE> </CENTER> <P> <jsp:usebean id="test" class="hall.simplebean" /> <jsp:setproperty name="test" property="message" value="hello WWW" /> <H1>Message: <I> <jsp:getproperty name="test" property="message" /> </I></H1> </BODY> </HTML> SimpleBean.java BeanTest jsp Bean
294 288 Java package hall; public class SimpleBean private String message = "No message specified"; public String getmessage() return(message); public void setmessage(string message) this.message = message; Java Bean package hall; public class SimpleBean private String message = "No message specified"; public String getmessage() return(message); public void setmessage(string message) this.message = message; package hall; public class SimpleBean private String message = "No message specified"; public String getmessage() return(message); public void setmessage(string message) this.message = message;
295 13 Java Server Pages 289 bean bean <jsp:usebean id="name" class="package.class" /> use jsp:setproperty and jsp:getproperty bean <jsp:usebean...> Body </jsp:usebean> bean Bean jsp:usebean id class scope, type beanname jsp:usedbean id class scope type Bean id scope Bean bean Bean page, request, session, application page Bean PageContext request Bean ServletRequest session Bean HttpSession application Bean ServletContext id scope jsp:usebean jsp:usebean jsp:setparameter id beanname bean bean beanname type class (3) jsp:setproperty jsp:setproperty bean jsp:usebean <jsp:usebean id="myname"... /> <jsp:setproperty name="myname" property="someproperty"... /> jsp:setproperty bean jsp:usebean <jsp:usebean id="myname"... >... <jsp:setproperty name="myname" property="someproperty".../> </jsp:usebean> bean
296 290 Java jsp:setproperty Name Property Value Bean jsp:usebean jsp:setproperty * bean name target wrapper value of numbers, boolean, Boolean, byte, Byte, char Character boolean true Boolean.valueOf 42 Integer.valueOf value param param Param null Bean numitems numberofitems <jsp:setproperty name="orderbean" property="numberofitems" param="numitems" /> param value Bean numdigits Bean numdigits numprimes JspPrimes.jsp <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>Reusing JavaBeans in JSP</TITLE> <LINK REL=STYLESHEET HREF="My-Style-Sheet.css" TYPE="text/css"> </HEAD> <BODY> <CENTER> <TABLE BORDER=5> <TR><TH CLASS="TITLE"> Reusing JavaBeans in JSP</TABLE> </CENTER> <P> <jsp:usebean id="primetable" class="hall.numberedprimes" /> <jsp:setproperty name="primetable" property="numdigits" /> <jsp:setproperty name="primetable" property="numprimes" /> Some <jsp:getproperty name="primetable" property="numdigits" />
297 13 Java Server Pages 291 digit primes: <jsp:getproperty name="primetable" property="numberedlist" /> </BODY> </HTML (4) jsp:getproperty Bean name jsp:usebean bean property <jsp:usebean id="itembean"... />... <UL> <LI>Number of items: <jsp:getproperty name="itembean" property="numitems" /> <LI>Cost of each: <jsp:getproperty name="itembean" property="unitcost" /> </UL> (5) jsp:forward page <jsp:forward page="hello1.jsp" /> <jsp:forward page="<%= somejavaexpression %>" /> Hello5.jsp Hello5.jsp 13.6 Hello1.jsp 13.6 (6) jsp:plugin Java Java applet 13-4
298 292 Java 13-4 <%-- comment --%> jsp <!-- comment --> html jsp <\% <%. %\> %>. \' \" %\> %> <\% <% 13.3 JSP 1 <!-- Number Guess Game --> <%@ page import = "num.numberguessbean" %> // Java Bean <jsp:usebean id="numguess" class="num.numberguessbean" scope="session"/> // Bean ID <jsp:setproperty name="numguess" property="*"/> // Bean numguess <html> <head><title>number Guess</title></head> <body bgcolor="white"> <font size=4> <!----- <% if (numguess.getsuccess()) %> // Bean //GetSuccess // Congratulations! You got it.
299 13 Java Server Pages 293 And after just <%= numguess.getnumguesses() %> tries.<p> // Bean //getnumguesses <% numguess.reset(); %> // Bean Reset Care to <a href="numguess.jsp">try again</a>? // <% else if (numguess.getnumguesses() == 0) %> // Welcome to the Number Guess game.<p> I'm thinking of a number between 1 and 100.<p> <form method=get> // // Get What's your guess? <input type=text name=guess> // <input type=submit value="submit"> // </form> // <% else %> Good guess, but nope. Try <b><%= numguess.gethint() %></b>. // // Bean gethint() You have made <%= numguess.getnumguesses() %> guesses.<p> // Bean getnumguesses I'm thinking of a number between 1 and 100.<p> <form method=get> What's your guess? <input type=text name=guess> <input type=submit value="submit"> </form> // <% %> </font>
300 294 Java </body> </html> Bean // Number Guess Game package num; import java.util.*; public class NumberGuessBean int answer; boolean success; String hint; int numguesses; public NumberGuessBean() reset(); public void setguess(string guess) numguesses++; int g; try g = Integer.parseInt(guess); catch (NumberFormatException e) g = -1; if (g == answer) success = true; else if (g == -1) hint = "a number next time"; else if (g < answer) hint = "higher"; else if (g > answer)
301 13 Java Server Pages 295 hint = "lower"; public boolean getsuccess() return success; public String gethint() return "" + hint; public int getnumguesses() return numguesses; public void reset() answer = Math.abs(new Random().nextInt() % 100) + 1; success = false; numguesses = 0; 13.7~ <html>
302 296 Java
303 13 Java Server Pages 297 <!-- --> <body bgcolor="white"> <jsp:usebean id='clock' scope='page' class='dates.jspcalendar' type="dates.jspcalendar" /> <font size=4> <ul> <li> Day of month: is <jsp:getproperty name="clock" property="dayofmonth"/> <li> Year: is <jsp:getproperty name="clock" property="year"/> <li> Month: is <jsp:getproperty name="clock" property="month"/> <li> Time: is <jsp:getproperty name="clock" property="time"/> <li> Date: is <jsp:getproperty name="clock" property="date"/> <li> Day: is <jsp:getproperty name="clock" property="day"/> <li> Day Of Year: is <jsp:getproperty name="clock" property="dayofyear"/> <li> Week Of Year: is <jsp:getproperty name="clock" property="weekofyear"/> <li> era: is <jsp:getproperty name="clock" property="era"/> <li> DST Offset: is <jsp:getproperty name="clock" property="dstoffset"/> <li> Zone Offset: is <jsp:getproperty name="clock" property="zoneoffset"/> </ul> </font> </body> </html> Bean package dates; import java.text.dateformat; import java.util.*; public class JspCalendar Calendar calendar = null; public JspCalendar() calendar = Calendar.getInstance(TimeZone.getTimeZone("PST")); Date trialtime = new Date(); calendar.settime(trialtime); public int getyear()
304 298 Java return calendar.get(calendar.year); public String getmonth() int m = getmonthint(); String[] months = new String [] "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ; if (m > 12) return "Unknown to Man"; return months[m - 1]; public String getday() int x = getdayofweek(); String[] days = new String[] "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"; if (x > 7) return "Unknown to Man"; return days[x - 1]; public int getmonthint() return 1 + calendar.get(calendar.month); public String getdate() return getmonthint() + "/" + getdayofmonth() + "/" + getyear(); public String gettime() return gethour() + ":" + getminute() + ":" + getsecond();
305 13 Java Server Pages 299 public int getdayofmonth() return calendar.get(calendar.day_of_month); public int getdayofyear() return calendar.get(calendar.day_of_year); public int getweekofyear() return calendar.get(calendar.week_of_year); public int getweekofmonth() return calendar.get(calendar.week_of_month); public int getdayofweek() return calendar.get(calendar.day_of_week); public int gethour() return calendar.get(calendar.hour_of_day); public int getminute() return calendar.get(calendar.minute); public int getsecond() return calendar.get(calendar.second); public static void main(string args[]) JspCalendar db = new JspCalendar(); p("date: " + db.getdayofmonth()); p("year: " + db.getyear()); p("month: " + db.getmonth()); p("time: " + db.gettime()); p("date: " + db.getdate());
306 300 Java p("day: " + db.getday()); p("dayofyear: " + db.getdayofyear()); p("weekofyear: " + db.getweekofyear()); p("era: " + db.getera()); p("ampm: " + db.getampm()); p("dst: " + db.getdstoffset()); p("zone Offset: " + db.getzoneoffset()); // p("timezone: " + db.getustimezone()); private static void p(string x) System.out.println(x); public int getera() return calendar.get(calendar.era); public String getustimezone() String[] zones = new String[] "Hawaii", "Alaskan", "Pacific", "Mountain", "Central", "Eastern"; int index = 10 + getzoneoffset(); if (index <= 5) return zones[10 + getzoneoffset()]; else return "Only US Time Zones supported"; public int getzoneoffset() return calendar.get(calendar.zone_offset)/(60*60*1000); public int getdstoffset() return calendar.get(calendar.dst_offset)/(60*60*1000); public int getampm()
307 13 Java Server Pages 301 return calendar.get(calendar.am_pm); HTTP <html> <body bgcolor="white"> <h1> Request Information </h1> <font size="4"> JSP Request Method: <jsp:expr> request.getmethod() </jsp:expr> <br> Request URI: <jsp:expr> request.getrequesturi() </jsp:expr> <br> Request Protocol: <jsp:expr> request.getprotocol() </jsp:expr> <br> Servlet path: <jsp:expr> request.getservletpath() </jsp:expr> <br> Path info: <jsp:expr> request.getpathinfo() </jsp:expr> <br> Path translated: <jsp:expr> request.getpathtranslated() </jsp:expr>
308 302 Java <br> Query string: <jsp:expr> request.getquerystring() </jsp:expr> <br> Content length: <jsp:expr> request.getcontentlength() </jsp:expr> <br> Content type: <jsp:expr> request.getcontenttype() </jsp:expr> <br> Server name: <jsp:expr> request.getservername() </jsp:expr> <br> Server port: <jsp:expr> request.getserverport() </jsp:expr> <br> Remote user: <jsp:expr> request.getremoteuser() </jsp:expr> <br> Remote address: <jsp:expr> request.getremoteaddr() </jsp:expr> <br> Remote host: <jsp:expr> request.getremotehost() </jsp:expr> <br> Authorization scheme: <jsp:expr> request.getauthtype() </jsp:expr> <hr> The browser you are using is <jsp:expr> request.getheader("user-agent") </jsp:expr> <hr> </font> </body> </html>
309 13 Java Server Pages <html> <body bgcolor="white"> <font size=5 color="red"> <%! String[] fruits; %> <jsp:usebean id="foo" scope="page" class="checkbox.checktest" /> <jsp:setproperty name="foo" property="fruit" param="fruit" /> <hr> The checked fruits (got using request) are: <br> <% fruits = request.getparametervalues("fruit"); %> <ul> <% if (fruits!= null) for (int i = 0; i < fruits.length; i++) %> <li> <% out.println (fruits[i]); else out.println ("none selected"); %> </ul> <br> <hr> The checked fruits (got using beans) are <br> <% fruits = foo.getfruit(); %> <ul> <% if (!fruits[0].equals("1")) for (int i = 0; i < fruits.length; i++) %> <li> <%
310 304 Java out.println (fruits[i]); else out.println ("none selected"); %> </ul> </font> </body> </html> Bean package checkbox; public class CheckTest String b[] = new String[] "1", "2", "3", "4" ; public String[] getfruit() return b; public void setfruit(string [] b) this.b = b;
311 13 Java Server Pages <html> <jsp:usebean id="cb" scope="session" class="colors.colorgamebean" /> <jsp:setproperty name="cb" property="*" /> <% cb.processrequest(request); %> <body bgcolor=<%= cb.getcolor1() %>> <font size=6 color=<%= cb.getcolor2() %>> <p> <% if (cb.gethint()==true) %> <p> Hint #1: Vampires prey at night! <p> <p> Hint #2: Nancy without the n. <% %> <% if (cb.getsuccess()==true) %>
312 306 Java <p> CONGRATULATIONS!! <% if (cb.gethinttaken()==true) %> <p> ( although I know you cheated and peeked into the hints) <% %> <% %> <p> Total attempts so far: <%= cb.getattempts() %> <p> <p> <form method=post action=colrs.jsp> Color #1: <input type=text name= color1 size=16> <br> Color #2: <input type=text name= color2 size=16> <p> <input type=submit name=action value="submit"> <input type=submit name=action value="hint"> </form> </font> </body> </html> Bean package colors; import javax.servlet.http.*; public class ColorGameBean private String background = "yellow";
313 13 Java Server Pages 307 private String foreground = "red"; private String color1 = foreground; private String color2 = background; private String hint = "no"; private int attempts = 0; private int intval = 0; private boolean tookhints = false; public void processrequest(httpservletrequest request) // background = "yellow"; // foreground = "red"; if (! color1.equals(foreground)) if (color1.equalsignorecase("black") color1.equalsignorecase("cyan")) background = color1; if (! color2.equals(background)) if (color2.equalsignorecase("black") color2.equalsignorecase("cyan")) foreground = color2; attempts++; public void setcolor2(string x) color2 = x; public void setcolor1(string x) color1 = x; public void setaction(string x) if (!tookhints)
314 308 Java tookhints = x.equalsignorecase("hint"); hint = x; public String getcolor2() return background; public String getcolor1() return foreground; public int getattempts() return attempts; public boolean gethint() return hint.equalsignorecase("hint"); public boolean getsuccess() if (background.equalsignorecase("black") background.equalsignorecase("cyan")) if (foreground.equalsignorecase("black") foreground.equalsignorecase("cyan")) return true; else return false; return false; public boolean gethinttaken() return tookhints; public void reset() foreground = "red";
315 13 Java Server Pages 309 background = "yellow"; public void setintval(int value) intval = value; public int getintval() return intval;
316 310 Java 6 <HTML> <HEAD><TITLE> Calendar: A JSP APPLICATION </TITLE></HEAD> <BODY BGCOLOR="white"> <%@ page language="java" import="cal.*" %> <jsp:usebean id="table" scope="session" class="cal.tablebean" /> <% table.processrequest(request); if (table.getprocesserror() == false) %> <!-- html table goes here --> <CENTER> <TABLE WIDTH=60% BGCOLOR=yellow CELLPADDING=15> <TR> <TD ALIGN=CENTER> <A HREF=cal1.jsp?date=prev> prev </A> <TD ALIGN=CENTER> Calendar:<%= table.getdate() %></TD> <TD ALIGN=CENTER> <A HREF=cal1.jsp?date=next> next </A> </TR> </TABLE> <!-- the main table --> <TABLE WIDTH=60% BGCOLOR=lightblue BORDER=1 CELLPADDING=10> <TR> <TH> Time </TH> <TH> Appointment </TH> </TR> <FORM METHOD=POST ACTION=cal1.jsp> <% for(int i=0; i<table.getentries().getrows(); i++) cal.entry entr = table.getentries().getentry(i); %>
317 13 Java Server Pages 311 <TR> <TD> <A HREF=cal2.jsp?time=<%= entr.gethour() %>> <%= entr.gethour() %> </A> </TD> <TD BGCOLOR=<%= entr.getcolor() %>> <%= entr.getdescription() %> </TD> </TR> <% %> </FORM> </TABLE> <BR> <!-- footer --> <TABLE WIDTH=60% BGCOLOR=yellow CELLPADDING=15> <TR> <TD ALIGN=CENTER> <%= table.getname() %> : <%= table.get () %> </TD> </TR> </TABLE> </CENTER> <% else %> <font size=5> You must enter your name and address correctly. </font> <% %> </BODY> </HTML> Bean package cal; import java.util.enumeration;
318 312 Java import java.util.hashtable; import javax.servlet.http.*; public class Entries private Hashtable entries; private static final String[] time = "8am", "9am", "10am", "11am", "12pm", "1pm", "2pm", "3pm", "4pm", "5pm", "6pm", "7pm", "8pm" ; public static final int rows = 12; public Entries () entries = new Hashtable (rows); for (int i=0; i < rows; i++) entries.put (time[i], new Entry(time[i])); public int getrows () return rows; public Entry getentry (int index) return (Entry)this.entries.get(time[index]); public int getindex (String tm) for (int i=0; i<rows; i++) if(tm.equals(time[i])) return i; return -1; public void processrequest (HttpServletRequest request, String tm) int index = getindex (tm); if (index >= 0) String descr = request.getparameter ("description"); ((Entry)entries.get(time[index])).setDescription (descr); package cal;
319 13 Java Server Pages 313 public class Entry String hour; String description; String color; public Entry (String hour) this.hour = hour; this.description = ""; public String gethour () return this.hour; public String getcolor () if (description.equals("")) return "lightblue"; else return "red"; public String getdescription () if (description.equals("")) return "None"; else return this.description; public void setdescription (String descr) description = descr; package cal; import java.text.dateformat; import java.util.*; public class JspCalendar Calendar calendar = null; Date currentdate;
320 314 Java public JspCalendar() calendar = Calendar.getInstance(); Date trialtime = new Date(); calendar.settime(trialtime); public int getyear() return calendar.get(calendar.year); public String getmonth() int m = getmonthint(); String[] months = new String [] "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ; if (m > 12) return "Unknown to Man"; return months[m - 1]; public String getday() int x = getdayofweek(); String[] days = new String[] "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"; if (x > 7) return "Unknown to Man"; return days[x - 1]; public int getmonthint() return 1 + calendar.get(calendar.month); public String getdate()
321 13 Java Server Pages 315 return getmonthint() + "/" + getdayofmonth() + "/" + getyear(); public String getcurrentdate() Date dt = new Date (); calendar.settime (dt); return getmonthint() + "/" + getdayofmonth() + "/" + getyear(); public String getnextdate() calendar.set (Calendar.DAY_OF_MONTH, getdayofmonth() + 1); return getdate (); public String getprevdate() calendar.set (Calendar.DAY_OF_MONTH, getdayofmonth() - 1); return getdate (); public String gettime() return gethour() + ":" + getminute() + ":" + getsecond(); public int getdayofmonth() return calendar.get(calendar.day_of_month); public int getdayofyear() return calendar.get(calendar.day_of_year); public int getweekofyear() return calendar.get(calendar.week_of_year); public int getweekofmonth() return calendar.get(calendar.week_of_month); public int getdayofweek()
322 316 Java return calendar.get(calendar.day_of_week); public int gethour() return calendar.get(calendar.hour_of_day); public int getminute() return calendar.get(calendar.minute); public int getsecond() return calendar.get(calendar.second); public int getera() return calendar.get(calendar.era); public String getustimezone() String[] zones = new String[] "Hawaii", "Alaskan", "Pacific", "Mountain", "Central", "Eastern"; int index = 10 + getzoneoffset(); if (index <= 5) return zones[10 + getzoneoffset()]; else return "Only US Time Zones are supported"; public int getzoneoffset() return calendar.get(calendar.zone_offset)/(60*60*1000); public int getdstoffset() return calendar.get(calendar.dst_offset)/(60*60*1000);
323 13 Java Server Pages 317 public int getampm() return calendar.get(calendar.am_pm); package cal; import java.beans.*; import javax.servlet.http.*; import javax.servlet.*; import java.util.hashtable; public class TableBean Hashtable table; JspCalendar JspCal; Entries entries; String date; String name = null; String = null; boolean processerror = false; public TableBean () this.table = new Hashtable (10); this.jspcal = new JspCalendar (); this.date = JspCal.getCurrentDate (); public void setname (String nm) this.name = nm; public String getname () return this.name; public void set (String mail)
324 318 Java this. = mail; public String get () return this. ; public String getdate () return this.date; public Entries getentries () return this.entries; public void processrequest (HttpServletRequest request) // Get the name and . this.processerror = false; if (name == null name.equals("")) setname(request.getparameter ("name")); if ( == null .equals("")) set (request.getparameter (" ")); if (name == null == null name.equals("") .equals("")) this.processerror = true; return; // Get the date. String dater = request.getparameter ("date"); if (dater == null) date = JspCal.getCurrentDate (); else if (dater.equalsignorecase("next")) date = JspCal.getNextDate (); else if (dater.equalsignorecase("prev")) date = JspCal.getPrevDate (); entries = (Entries) table.get (date); if (entries == null) entries = new Entries (); table.put (date, entries); // If time is provided add the event.
325 13 Java Server Pages 319 String time = request.getparameter("time"); if (time!= null) entries.processrequest (request, time); public boolean getprocesserror () return this.processerror; 13.17~
326 320 Java Include JSP Include <html> <body bgcolor="white"> <font color="red">
327 13 Java Server Pages page buffer="5" autoflush="false" %> <p>in place evaluation of another JSP which gives you the current time: include file="foo.jsp" %> <p> <jsp:include page="/jsp/include/foo.html" flush="true"/> by including the output of another JSP: <jsp:include page="foo.jsp" flush="true"/>
328 322 Java :-) </html> <body bgcolor="white"> <font color="red"> <%= System.currentTimeMillis() %> Forward Forward <% double freemem = Runtime.getRuntime().freeMemory(); double totlmem = Runtime.getRuntime().totalMemory(); double percent = freemem/totlmem; if (percent < 0.5) %> <jsp:forward page="/jsp/forward/one.jsp"/> <% else %> <jsp:forward page="two.html"/> <% %> </html> <body bgcolor="white"> <font color="red"> VM Memory usage < 50%. </html> 13.24
329 13 Java Server Pages % 9 Plugin JSP Java Applet <title> Plugin example </title> <body bgcolor="white"> <h3> Current time is : </h3> <jsp:plugin type="applet" code="clock2.class" codebase="/examples/jsp/plugin/applet" jreversion="1.2" width="160" height="150" > <jsp:fallback> Plugin tag OBJECT or EMBED not supported by browser. </jsp:fallback> </jsp:plugin> <p> <h4> <font color=red> The above applet is loaded using the Java Plugin from a jsp page using the plugin tag. </font> </h4> </body> </html> Applet import java.util.*; import java.awt.*; import java.applet.*; import java.text.*; /**
330 324 Java * Time! * */ public class Clock2 extends Applet implements Runnable Thread timer; // The thread that displays clock int lastxs, lastys, lastxm, lastym, lastxh, lastyh; // Dimensions used to draw hands SimpleDateFormat formatter; // Formats the date displayed String lastdate; // String to hold date displayed Font clockfacefont; // Font for number display on clock Date currentdate; // Used to get date to display Color handcolor; // Color of main hands and dial Color numbercolor; // Color of second hand and numbers public void init() int x,y; lastxs = lastys = lastxm = lastym = lastxh = lastyh = 0; formatter = new SimpleDateFormat ("EEE MMM dd hh:mm:ss yyyy", Locale.getDefault()); currentdate = new Date(); lastdate = formatter.format(currentdate); clockfacefont = new Font("Serif", Font.PLAIN, 14); handcolor = Color.blue; numbercolor = Color.darkGray; try setbackground(new Color(Integer.parseInt(getParameter("bgcolor"),16))); catch (Exception E) try handcolor = new Color(Integer.parseInt(getParameter("fgcolor1"),16)); catch (Exception E) try numbercolor = new Color(Integer.parseInt(getParameter("fgcolor2"),16)); catch (Exception E) resize(300,300); // Set clock window size // Plotpoints allows calculation to only cover 45 degrees of the circle, // and then mirror
331 13 Java Server Pages 325 public void plotpoints(int x0, int y0, int x, int y, Graphics g) g.drawline(x0+x,y0+y,x0+x,y0+y); g.drawline(x0+y,y0+x,x0+y,y0+x); g.drawline(x0+y,y0-x,x0+y,y0-x); g.drawline(x0+x,y0-y,x0+x,y0-y); g.drawline(x0-x,y0-y,x0-x,y0-y); g.drawline(x0-y,y0-x,x0-y,y0-x); g.drawline(x0-y,y0+x,x0-y,y0+x); g.drawline(x0-x,y0+y,x0-x,y0+y); // Circle is just Bresenham's algorithm for a scan converted circle public void circle(int x0, int y0, int r, Graphics g) int x,y; float d; x=0; y=r; d=5/4-r; plotpoints(x0,y0,x,y,g); while (y>x) if (d<0) d=d+2*x+3; x++; else d=d+2*(x-y)+5; x++; y--; plotpoints(x0,y0,x,y,g); // Paint is the main part of the program public void paint(graphics g) int xh, yh, xm, ym, xs, ys, s = 0, m = 10, h = 10, xcenter, ycenter; String today; currentdate = new Date();
332 326 Java SimpleDateFormat formatter = new SimpleDateFormat("s",Locale.getDefault()); try s = Integer.parseInt(formatter.format(currentDate)); catch (NumberFormatException n) s = 0; formatter.applypattern("m"); try m = Integer.parseInt(formatter.format(currentDate)); catch (NumberFormatException n) m = 10; formatter.applypattern("h"); try h = Integer.parseInt(formatter.format(currentDate)); catch (NumberFormatException n) h = 10; formatter.applypattern("eee MMM dd HH:mm:ss yyyy"); today = formatter.format(currentdate); xcenter=80; ycenter=55; // a= s* pi/2 - pi/2 (to switch 0,0 from 3:00 to 12:00) // x = r(cos a) + xcenter, y = r(sin a) + ycenter xs = (int)(math.cos(s * 3.14f/ f/2) * 45 + xcenter); ys = (int)(math.sin(s * 3.14f/ f/2) * 45 + ycenter); xm = (int)(math.cos(m * 3.14f/ f/2) * 40 + xcenter); ym = (int)(math.sin(m * 3.14f/ f/2) * 40 + ycenter); xh = (int)(math.cos((h*30 + m/2) * 3.14f/ f/2) * 30 + xcenter); yh = (int)(math.sin((h*30 + m/2) * 3.14f/ f/2) * 30 + ycenter); // Draw the circle and numbers g.setfont(clockfacefont); g.setcolor(handcolor); circle(xcenter,ycenter,50,g); g.setcolor(numbercolor); g.drawstring("9",xcenter-45,ycenter+3);
333 13 Java Server Pages 327 g.drawstring("3",xcenter+40,ycenter+3); g.drawstring("12",xcenter-5,ycenter-37); g.drawstring("6",xcenter-3,ycenter+45); // Erase if necessary, and redraw g.setcolor(getbackground()); if (xs!= lastxs ys!= lastys) g.drawline(xcenter, ycenter, lastxs, lastys); g.drawstring(lastdate, 5, 125); if (xm!= lastxm ym!= lastym) g.drawline(xcenter, ycenter-1, lastxm, lastym); g.drawline(xcenter-1, ycenter, lastxm, lastym); if (xh!= lastxh yh!= lastyh) g.drawline(xcenter, ycenter-1, lastxh, lastyh); g.drawline(xcenter-1, ycenter, lastxh, lastyh); g.setcolor(numbercolor); g.drawstring("", 5, 125); g.drawstring(today, 5, 125); g.drawline(xcenter, ycenter, xs, ys); g.setcolor(handcolor); g.drawline(xcenter, ycenter-1, xm, ym); g.drawline(xcenter-1, ycenter, xm, ym); g.drawline(xcenter, ycenter-1, xh, yh); g.drawline(xcenter-1, ycenter, xh, yh); lastxs=xs; lastys=ys; lastxm=xm; lastym=ym; lastxh=xh; lastyh=yh; lastdate = today; currentdate=null; public void start() timer = new Thread(this); timer.start(); public void stop() timer = null;
334 328 Java public void run() Thread me = Thread.currentThread(); while (timer == me) try Thread.currentThread().sleep(100); catch (InterruptedException e) repaint(); public void update(graphics g) paint(g); public String getappletinfo() return "Title: A Clock \nauthor: Rachel Gollub, 1995 \nan analog clock."; public String[][] getparameterinfo() String[][] info = "bgcolor", "hexadecimal RGB number", "The background color. Default is the color of your browser.", "fgcolor1", "hexadecimal RGB number", "The color of the hands and dial. Default is blue.", "fgcolor2", "hexadecimal RGB number", "The color of the seconds hand and numbers. Default is dark gray." ; return info; JSP Servlet JSP Servlet JSP <body bgcolor="white"> <!-- Forward to a servlet -->
335 13 Java Server Pages Applet <jsp:forward page="/servlet/servlettojsp" /> </html> Servlet import javax.servlet.*; import javax.servlet.http.*; public class servlettojsp extends HttpServlet public void doget (HttpServletRequest request, HttpServletResponse response) try // Set the attribute and Forward to hello.jsp request.setattribute ("servletname", "servlettojsp"); getservletconfig().getservletcontext().getrequestdispatcher("/jsp/jsptoserv/hello.jsp").forward (request, response); catch (Exception ex) ex.printstacktrace ();
336 330 Java JSP Servlet 13.4 JSP JDBC JDBC JSP JDBC JSP JSP JSP JDBC DRIVER JDBC-ODBC Windows 98 JDBC-ODBC Servlet JSP <html> <head> <title>jsp JDBC</title> </head> <body text=blue> page contenttype="text/html;charset=gb2312"%> <% // java.sql.connection sqlcon; // java.sql.statement sqlstmt; //SQL
337 java.sql.resultset sqlrst; // 13 Java Server Pages 331 java.lang.string strcon; // java.lang.string strsql; //SQL Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); // strcon = "jdbc:odbc:test_db"; // sqlcon = java.sql.drivermanager.getconnection(strcon,"sa",""); // SQL sqlstmt = sqlcon.createstatement(); // strsql = "select * from TITLES"; sqlrst = sqlstmt.executequery(strsql); // SQL while(sqlrst.next()) for(int i=1;i<11;i++) %> <%=i%> <%=sqlrst.getstring(i)%><br> <% // sqlrst.close(); // SQL
338 332 Java sqlstmt.close(); // sqlcon.close(); %> </body> </html> TITLES An overview of available database systems with emphasis on common business applications. Illustrated :00: BU1046 The Busy Executive Database Guide women An overview of available database systems with :00: BU1111 Cooking with Computers: Surreptitious Balance Sheets business Helpful hints on how to use your electronic resources to the best advantage :00: BU2075 You Can Combat Computer Stress! business The latest medical and psychological techniques for living JSP ASP ASP JSP Windows Windows NT ASP JSP ASP 2 JSP Servlet JSP ASCII Servlet Servlet 3 Java Bean COM JavaBean COM COM Windows JavaBean
339 14 JDBC API Java JSP Servlet JDBC JDBC API Servlet,JSP 14.1 Class DriverManager 1 public class DriverManager extends Object JDBC 2 static void deregisterdriver(driver driver) static Connection getconnection(string url) static Connection getconnection(string url, Properties info) static Connection getconnection(string url, String user, String password) static Driver getdriver(string url) static Enumeration getdrivers() static int getlogintimeout() static PrintStream getlogstream() static PrintWriter getlogwriter() static void println(string message) static void registerdriver(driver driver) static void setlogintimeout(int seconds) static void setlogstream(printstream out) static void setlogwriter(printwriter out) void deregisterdriver public
340 334 Java Driver throws SQLException Applet GetConnection public Connection String throws SQLException getconnection public Connection String Property throws SQLException Property getconnection public Connection String String String throws SQLException GetDriver public Driver String throws SQLException getdrivers
341 14 JDBC API 335 public Enumeration throws SQLException setlogintimeout public throws SQLException getlogintimeout public throws SQLException setlogstream public PrintStream throws SQLException getlogstream public PrintStream throws SQLException println
342 336 Java public String throws SQLException 14.2 Interface Driver 1 public abstract interface Driver 2 boolean acceptsurl(string url) Connection connect(string url, Properties info) int getmajorversion() int getminorversion() DriverPropertyInfo[] getpropertyinfo(string url, Properties info) boolean jdbccompliant() connect public Connection String Properties throws SQLException acceptsurl public String throws SQLException
343 14 JDBC API 337 getpropertyinfo public DriverPropertyInfo String Properties throws SQLException getmajorversion public throws SQLException getminorversion public throws SQLException jdbccompliant public throws SQLException JDBC COMPLIANT 14.3 Class DriverPropertyInfo 1 public class DriverPropertyInfo extends Object
344 338 Java 2 String[] choices String description String name boolean required String value name public String description public String NULL required public true null false Value public String Choices public String 3 DriverPropertyInfo public String String DriverPropertyInfo
345 14 JDBC API Interface Connection 1 public abstract interface Connection 2 void clearwarnings() void close() void commit() Statement createstatement() Statement createstatement(int resultsettype, int resultsetconcurrency) boolean getautocommit() String getcatalog() DatabaseMetaData getmetadata() int gettransactionisolation() Map gettypemap() SQLWarning getwarnings() boolean isclosed() boolean isreadonly() String nativesql(string sql) CallableStatement preparecall(string sql) CallableStatement preparecall(string sql, int resultsettype, int resultsetconcurrency) PreparedStatement preparestatement(string sql) PreparedStatement preparestatement(string sql, int resultsettype, int resultsetconcurrency) void rollback() void setautocommit(boolean autocommit) void setcatalog(string catalog) void setreadonly(boolean readonly) void settransactionisolation(int level) void settypemap(map map) createstatement public Statement
346 340 Java throws SQLException Statement preparestatement public PreparedStatement String throws SQLException PreparedStatement preparecall public CallableStatement String throws SQLException CallableStatement nativesql public String throws SQLException SQL SQL setautocommit public throws SQLException getautocommit public
347 throws SQLException commit public throws SQLException rollback public throws SQLException close public throws SQLException Connection isclosed public throws SQLException getmetadata public DatabaseMetaData 14 JDBC API 341
348 342 Java throws SQLException DatabaseMetaData setreadonly public throws SQLException isreadonly public throws SQLException setcatalog public String throws SQLException getcatalog public String Catalog throws SQLException settransactionisolation public
349 throws SQLException gettransactionisolation public throws SQLException 14 JDBC API 343 getwarnings public SQLWarning throws SQLException SQL Warning clearwarnings public throws SQLException SQL Warning createstatement public Statement String Result String Currency throws SQLException Statement ResultSet Currency PrepareStatement public PreparedStatement
350 344 Java String String Result String Currency throws SQLException PreparedStatement ResultSet Currency PrepareCall public CallableStatement String String Result String Currency throws SQLException CallableStatement ResultSet Currency GetTypeMap public Map throws SQLException Map settypemap public Map throws SQLException Map 14.5 Interface PreparedStatement 1 public abstract interface PreparedStatement extends Statement void addbatch()
351 14 JDBC API 345 void clearparameters() boolean execute() ResultSet executequery() int executeupdate() ResultSetMetaData getmetadata() void setarray(int i, Array x) void setasciistream(int parameterindex, InputStream x, int length) void setbigdecimal(int parameterindex, BigDecimal x) void setbinarystream(int parameterindex, InputStream x, int length) void setblob(int i, Blob x) void setboolean(int parameterindex, boolean x) void setbyte(int parameterindex, byte x) void setbytes(int parameterindex, byte[] x) void setcharacterstream(int parameterindex, Reader reader, int length) void setclob(int i, Clob x) void setdate(int parameterindex, Date x) void setdate(int parameterindex, Date x, Calendar cal) void setdouble(int parameterindex, double x) void setfloat(int parameterindex, float x) void setint(int parameterindex, int x) void setlong(int parameterindex, long x) void setnull(int parameterindex, int sqltype) void setnull(int paramindex, int sqltype, String typename) void setobject(int parameterindex, Object x) void setobject(int parameterindex, Object x, int targetsqltype) void setobject(int parameterindex, Object x, int targetsqltype, int scale) void setref(int i, Ref x) void setshort(int parameterindex, short x) void setstring(int parameterindex, String x) void settime(int parameterindex, Time x) void settime(int parameterindex, Time x, Calendar cal) void settimestamp(int parameterindex, Timestamp x) void settimestamp(int parameterindex, Timestamp x, Calendar cal) void setunicodestream(int parameterindex, InputStream x, int length) executequery public ResultSet String SQL
352 346 Java throws SQLException executeupdate public String SQL throws SQLException setnull public int int SQL TYPE throws SQLException null setboolean public int throws SQLException setbyte public int Byte throws SQLException Byte setshort public int Short
353 14 JDBC API 347 throws SQLException Short setint public int Int throws SQLException Int setlong public int Long throws SQLException Long setfloat public int Float throws SQLException Float setdouble public int Double throws SQLException Double setbigdecimal public int BigDecimal
354 348 Java throws SQLException BigDecimal setstring public int String throws SQLException String setbytes public int Byte throws SQLException Byte setdate public int Date throws SQLException Date settime public int Time throws SQLException Time settimestamp public int Timestamp
355 14 JDBC API 349 throws SQLException Timestamp setasciistream public int InputStream Int throws SQLException setunicodestream public int InputStream Int throws SQLException Unicode setbianrystream public int InputStream Int throws SQLException Binary clearparameters public throws SQLException setobject public int Object Int SqlType Int
356 350 Java throws SQLException Object setobject public int Object Int SqlType throws SQLException Object 0 setobject public int Object throws SQLException Object SQL TYPE 0 execute public throws SQLException addbatch public throws SQLException setcharacterstream public int Reader Int
357 14 JDBC API 351 throws SQLException setref public int Ref throws SQLException Ref setblob public int Blob throws SQLException Blob setclob public int Clob throws SQLException Clob setarray public int Array throws SQLException Array getmetadata public ResultSetMetaData
358 352 Java throws SQLException ResultSetMetaData setdate public int Date Callender throws SQLException Date Callender Driver settime public int Time Callender throws SQLException Time Callender Driver settimestamp public int Timestamp Callender throws SQLException Timestamp Callender Driver SetNull public sqltype String throws SQLException null 14.6 Interface ResultSet 1
359 public abstract interface ResultSet 2 static int CONCUR_READ_ONLY static int CONCUR_UPDATABLE static int FETCH_FORWARD static int FETCH_REVERSE static int FETCH_UNKNOWN static int TYPE_FORWARD_ONLY static int TYPE_SCROLL_INSENSITIVE static int TYPE_SCROLL_SENSITIVE FETCH_FORWARD public static final FETCH_REVERSE public static final FETCH_UNKNOWN public static final TYPE_FORWARD_ONLY public static final 14 JDBC API 353 TYPE_SCROLL_INSENSITIVE public static final TYPE_SCROLL_SENSITIVE public static final CONCUR_READ_ONLY public static final
360 354 Java CONCUR_UPDATABLE public static final 3 boolean absolute(int row) void afterlast() void beforefirst() void cancelrowupdates() void clearwarnings() void close() void deleterow() int findcolumn(string columnname) boolean first() Array getarray(int i) Array getarray(string colname) InputStream getasciistream(int columnindex) InputStream getasciistream(string columnname) BigDecimal getbigdecimal(int columnindex) BigDecimal getbigdecimal(int columnindex, int scale) BigDecimal getbigdecimal(string columnname) BigDecimal getbigdecimal(string columnname, int scale) InputStream getbinarystream(int columnindex) InputStream getbinarystream(string columnname) Blob getblob(int i) Blob getblob(string colname) boolean getboolean(int columnindex) boolean getboolean(string columnname) byte getbyte(int columnindex) byte getbyte(string columnname) byte[] getbytes(int columnindex) byte[] getbytes(string columnname) Reader getcharacterstream(int columnindex) Reader getcharacterstream(string columnname) Clob getclob(int i) Clob getclob(string colname) int getconcurrency()
361 14 JDBC API 355 String getcursorname() Date getdate(int columnindex) Date getdate(int columnindex, Calendar cal) Date getdate(string columnname) Date getdate(string columnname, Calendar cal) double getdouble(int columnindex) double getdouble(string columnname) int getfetchdirection() int getfetchsize() float getfloat(int columnindex) float getfloat(string columnname) int getint(int columnindex) int getint(string columnname) long getlong(int columnindex) long getlong(string columnname) ResultSetMetaData getmetadata() Object getobject(int columnindex) Object getobject(int i, Map map) Object getobject(string columnname) Object getobject(string colname, Map map) Ref getref(int i) Ref getref(string colname) int getrow() short getshort(int columnindex) short getshort(string columnname) Statement getstatement() String getstring(int columnindex) String getstring(string columnname) Time gettime(int columnindex) Time gettime(int columnindex, Calendar cal) Time gettime(string columnname) Time gettime(string columnname, Calendar cal) Timestamp gettimestamp(int columnindex) Timestamp gettimestamp(int columnindex, Calendar cal) Timestamp gettimestamp(string columnname) Timestamp gettimestamp(string columnname, Calendar cal) int gettype() InputStream getunicodestream(int columnindex) InputStream getunicodestream(string columnname) SQLWarning getwarnings()
362 356 Java void insertrow() boolean isafterlast() boolean isbeforefirst() boolean isfirst() boolean islast() boolean last() void movetocurrentrow() void movetoinsertrow() boolean next() boolean previous() void refreshrow() boolean relative(int rows) boolean rowdeleted() boolean rowinserted() boolean rowupdated() void setfetchdirection(int direction) void setfetchsize(int rows) void updateasciistream(int columnindex, InputStream x, int length) void updateasciistream(string columnname, InputStream x, int length) void updatebigdecimal(int columnindex, BigDecimal x) void updatebigdecimal(string columnname, BigDecimal x) void updatebinarystream(int columnindex, InputStream x, int length) void updatebinarystream(string columnname, InputStream x, int length) void updateboolean(int columnindex, boolean x) void updateboolean(string columnname, boolean x) void updatebyte(int columnindex, byte x) void updatebyte(string columnname, byte x) void updatebytes(int columnindex, byte[] x) void updatebytes(string columnname, byte[] x) void updatecharacterstream(int columnindex, Reader x, int length) void updatecharacterstream(string columnname, Reader reader, int length) void updatedate(int columnindex, Date x) void updatedate(string columnname, Date x) void updatedouble(int columnindex, double x) void updatedouble(string columnname, double x) void updatefloat(int columnindex, float x) void updatefloat(string columnname, float x) void updateint(int columnindex, int x) void updateint(string columnname, int x) void updatelong(int columnindex, long x)
363 void updatelong(string columnname, long x) void updatenull(int columnindex) void updatenull(string columnname) void updateobject(int columnindex, Object x) void updateobject(int columnindex, Object x, int scale) void updateobject(string columnname, Object x) void updateobject(string columnname, Object x, int scale) void updaterow() void updateshort(int columnindex, short x) void updateshort(string columnname, short x) void updatestring(int columnindex, String x) void updatestring(string columnname, String x) void updatetime(int columnindex, Time x) void updatetime(string columnname, Time x) void updatetimestamp(int columnindex, Timestamp x) void updatetimestamp(string columnname, Timestamp x) boolean wasnull() next public throws SQLException close public throws SQLException wasnull public throws SQLException 14 JDBC API 357
364 358 Java null getstring public String throws SQLException getboolean public throws SQLException getbyte public Byte throws SQLException Byte getshort public short throws SQLException Short getint public Int throws SQLException
365 Int getlong public Long throws SQLException Long getfloat public Float throws SQLException Float getdouble public Double throws SQLException Double getdecimal public Bigdecimal throws SQLException BigDecimal getbytes public byte throws SQLException 14 JDBC API 359
366 360 Java Byte getdate public Date throws SQLException Date gettime public Time throws SQLException Time gettimestamp public TimeStamp throws SQLException TimeStamp getasciistream public InputStream throws SQLException getunicodestream public InputStream throws SQLException
367 Unicode getbinarystream public InputStream throws SQLException getstring public String String throws SQLException String getboolean public Boolean String throws SQLException Bool getbyte public Byte String throws SQLException Byte getshort public Short Short throws SQLException 14 JDBC API 361
368 362 Java Short getint public Int String throws SQLException Int getlong public Long String throws SQLException Long getfloat public Float String throws SQLException Float getdouble public Double String throws SQLException Double getbigdecimal public BigDecimal String throws SQLException
369 BigDecimal getbytes public Byte String throws SQLException Byte getdate public Date String throws SQLException Date gettime public Time String throws SQLException Time gettimestamp public TimeStamp String throws SQLException Timestamp getasciistream public String throws SQLException 14 JDBC API 363
370 364 Java getunicodestream public String throws SQLException Unicode getbinarystream public String throws SQLException getwarnings public SQLWarning throws SQLException SQLWarning clearwarnings public throws SQLException SQLWarnings getcursorname public String throws SQLException
371 14 JDBC API 365 getmetadata public ResultSetMetaData throws SQLException ResultSetMetaData getobject public Object Int throws SQLException Object getobject public Object String throws SQLException Object FindColumn public String throws SQLException getcharacterstream public Reader throws SQLException
372 366 Java getcharacterstream public Reader String throws SQLException IsBeforeFirst public throws SQLException isafterlast public throws SQLException isfirst public throws SQLException islast public throws SQLException
373 beforefirst public throws SQLException afterlast public throws SQLException first public throws SQLException last public throws SQLException getrow public throws SQLException 14 JDBC API 367
374 368 Java absolute public throws SQLException relative public throws SQLException previous public throws SQLException setfetchdirection public throws SQLException getfetchdirection public throws SQLException
375 setfetchsize public throws SQLException 14 JDBC API 369 getfetchsize public throws SQLException gettype public throws SQLException TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, or TYPE_SCROLL_SENSITIVE getconcurrency public throws SQLException Corrency CONCUR_READ_ONLY or CONCUR_UPDATABLE
ebook45-5
5 S Q L SQL Server 5.1 5-1 SQL Server 5-1 A B S A C O S A S I N ATA N AT N 2 C E I L I N G C O S C O T D E G R E E S E X P F L O O R L O G L O G 10 P I P O W E R R A D I A N S R A N D R O U N D S I G N
Microsoft Word - 01.DOC
第 1 章 JavaScript 简 介 JavaScript 是 NetScape 公 司 为 Navigator 浏 览 器 开 发 的, 是 写 在 HTML 文 件 中 的 一 种 脚 本 语 言, 能 实 现 网 页 内 容 的 交 互 显 示 当 用 户 在 客 户 端 显 示 该 网 页 时, 浏 览 器 就 会 执 行 JavaScript 程 序, 用 户 通 过 交 互 式 的
untitled
JavaEE+Android - 6 1.5-2 JavaEE web MIS OA ERP BOSS Android Android Google Map office HTML CSS,java Android + SQL Sever JavaWeb JavaScript/AJAX jquery Java Oracle SSH SSH EJB+JBOSS Android + 1. 2. IDE
1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10
Java V1.0.1 2007 4 10 1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10 6.2.10 6.3..10 6.4 11 7.12 7.1
epub 61-2
2 Web Dreamweaver UltraDev Dreamweaver 3 We b We b We Dreamweaver UltraDev We b Dreamweaver UltraDev We b We b 2.1 Web We b We b D r e a m w e a v e r J a v a S c r i p t We b We b 2.1.1 Web We b C C +
untitled
-JAVA 1. Java IDC 20 20% 5 2005 42.5 JAVA IDC JAVA 60% 70% JAVA 3 5 10 JAVA JAVA JAVA J2EE J2SE J2ME 70% JAVA JAVA 20 1 51 2. JAVA SUN JAVA J2EE J2EE 3. 1. CSTP CSTP 2 51 2. 3. CSTP IT CSTP IT IT CSTP
FY.DOC
高 职 高 专 21 世 纪 规 划 教 材 C++ 程 序 设 计 邓 振 杰 主 编 贾 振 华 孟 庆 敏 副 主 编 人 民 邮 电 出 版 社 内 容 提 要 本 书 系 统 地 介 绍 C++ 语 言 的 基 本 概 念 基 本 语 法 和 编 程 方 法, 深 入 浅 出 地 讲 述 C++ 语 言 面 向 对 象 的 重 要 特 征 : 类 和 对 象 抽 象 封 装 继 承 等 主
目錄
資 訊 素 養 線 上 教 材 單 元 五 資 料 庫 概 論 及 Access 5.1 資 料 庫 概 論 5.1.1 為 什 麼 需 要 資 料 庫? 日 常 生 活 裡 我 們 常 常 需 要 記 錄 一 些 事 物, 以 便 有 朝 一 日 所 記 錄 的 事 物 能 夠 派 得 上 用 場 我 們 能 藉 由 記 錄 每 天 的 生 活 開 銷, 就 可 以 在 每 個 月 的 月 底 知
附录J:Eclipse教程
附 录 J:Eclipse 教 程 By Y.Daniel Liang 该 帮 助 文 档 包 括 以 下 内 容 : Eclipse 入 门 选 择 透 视 图 创 建 项 目 创 建 Java 程 序 编 译 和 运 行 Java 程 序 从 命 令 行 运 行 Java Application 在 Eclipse 中 调 试 提 示 : 在 学 习 完 第 一 章 后 使 用 本 教 程 第
1. 访 问 最 新 发 行 公 告 信 息 jconnect for JDBC 7.0 1. 访 问 最 新 发 行 公 告 信 息 最 新 版 本 的 发 行 公 告 可 以 从 网 上 获 得 若 要 查 找 在 本 产 品 发 布 后 增 加 的 重 要 产 品 或 文 档 信 息, 请 访
发 行 公 告 jconnect for JDBC 7.0 文 档 ID:DC74874-01-0700-01 最 后 修 订 日 期 :2010 年 3 月 2 日 主 题 页 码 1. 访 问 最 新 发 行 公 告 信 息 2 2. 产 品 摘 要 2 3. 特 殊 安 装 说 明 2 3.1 查 看 您 的 jconnect 版 本 3 4. 特 殊 升 级 指 导 3 4.1 迁 移 3
Microsoft Word - CIN-DLL.doc
6.3. 调 用 动 态 链 接 库 (DLL) 相 对 于 CIN 来 讲,NI 更 推 荐 用 户 使 用 DLL 来 共 享 基 于 文 本 编 程 语 言 开 发 的 代 码 除 了 共 享 或 重 复 利 用 代 码, 开 发 人 员 还 能 利 用 DLL 封 装 软 件 的 功 能 模 块, 以 便 这 些 模 块 能 被 不 同 开 发 工 具 利 用 在 LabVIEW 中 使 用
四川省普通高等学校
四 川 省 普 通 高 等 学 校 计 算 机 应 用 知 识 和 能 力 等 级 考 试 考 试 大 纲 (2013 年 试 行 版 ) 四 川 省 教 育 厅 计 算 机 等 级 考 试 中 心 2013 年 1 月 目 录 一 级 考 试 大 纲 1 二 级 考 试 大 纲 6 程 序 设 计 公 共 基 础 知 识 6 BASIC 语 言 程 序 设 计 (Visual Basic) 9
关 于 我 姓 名 : 葛 云 杰 网 名 :Dylan Oracle OCM Oracle 用 户 组 年 轻 专 家 中 国 OCM 联 盟 成 员 山 东 Oracle 用 户 组 联 合 创 始 人 齐 鲁 IT 联 盟 联 合 创 始 人 软 件 研 发 工 程 师 具 有 十 年 以 上
分 享 技 术 分 享 快 乐 葛 云 杰 (Fiyo) 电 话 :18660746900 邮 箱 :[email protected] 关 于 我 姓 名 : 葛 云 杰 网 名 :Dylan Oracle OCM Oracle 用 户 组 年 轻 专 家 中 国 OCM 联 盟 成 员 山 东 Oracle 用 户 组 联 合 创 始 人 齐 鲁 IT 联 盟 联 合 创 始 人 软 件 研 发 工 程
ebook140-8
8 Microsoft VPN Windows NT 4 V P N Windows 98 Client 7 Vintage Air V P N 7 Wi n d o w s NT V P N 7 VPN ( ) 7 Novell NetWare VPN 8.1 PPTP NT4 VPN Q 154091 M i c r o s o f t Windows NT RAS [ ] Windows NT4
软件测试(TA07)第一学期考试
一 判 断 题 ( 每 题 1 分, 正 确 的, 错 误 的,20 道 ) 1. 软 件 测 试 按 照 测 试 过 程 分 类 为 黑 盒 白 盒 测 试 ( ) 2. 在 设 计 测 试 用 例 时, 应 包 括 合 理 的 输 入 条 件 和 不 合 理 的 输 入 条 件 ( ) 3. 集 成 测 试 计 划 在 需 求 分 析 阶 段 末 提 交 ( ) 4. 单 元 测 试 属 于 动
基于CDIO一体化理念的课程教学大纲设计
Java 语 言 程 序 设 计 课 程 教 学 大 纲 Java 语 言 程 序 设 计 课 程 教 学 大 纲 一 课 程 基 本 信 息 1. 课 程 代 码 :52001CC022 2. 课 程 名 称 :Java 语 言 程 序 设 计 3. 课 程 英 文 名 称 :Java Programming 4. 课 程 类 别 : 理 论 课 ( 含 实 验 上 机 或 实 践 ) 5. 授
习题1
习 题 1 数 据 库 系 统 基 本 概 念 1.1 名 词 解 释 DB DB 是 长 期 存 储 在 计 算 机 内 有 组 织 的 统 一 管 理 的 相 关 数 据 的 集 合 DB 能 为 各 种 用 户 共 享, 具 有 较 小 冗 余 度 数 据 间 联 系 紧 密 而 又 有 较 高 的 数 据 独 立 性 等 特 点 DBMS 是 位 于 用 户 与 操 作 系 统 之 间 的
尽 管 Java 语 言 是 在 C++ 语 言 基 础 上 发 展 起 来 的, 但 与 C++ 不 同,Java 是 一 种 纯 粹 的 面 向 对 象 语 言 (Object-oriented language) 在 Java 世 界 中, 所 有 事 物 都 是 Object 1. 通 过
玩 转 Object 不 理 解, 就 无 法 真 正 拥 有 歌 德 按 其 实 而 审 其 名, 以 求 其 情 ; 听 其 言 而 查 其 累, 无 使 放 悖 ( 根 据 实 际 明 辨 名 称, 以 便 求 得 真 实 情 况 ; 听 取 言 辞 后 弄 明 它 的 类 别, 不 让 它 混 淆 错 乱 ) 三 玩 转 Object 大 围 山 人 玩 转 Object...1 1. 通
<4D6963726F736F667420576F7264202D20C9CFBAA3CAD0BCC6CBE3BBFAB5C8BCB6BFBCCAD4C8FDBCB6BFBCCAD4B4F3B8D95FBDA8D2E9B8E55F5F303632352E646F63>
上 海 市 高 等 学 校 计 算 机 等 级 考 试 ( 三 级 ) 考 试 大 纲 -- 建 议 稿 -- 2007-6-25 25 目 录 上 海 市 高 等 学 校 计 算 机 等 级 考 试 三 级 总 体 说 明 -----------------1 三 级 ( 计 算 机 系 统 与 网 络 技 术 ) 考 试 大 纲 ---------------------2 三 级 ( 管 理
尽 管 Java 语 言 是 在 C++ 语 言 基 础 上 发 展 起 来 的, 但 是 有 别 于 C++,Java 是 一 种 纯 粹 的 面 向 对 象 语 言 (Object-oriented language) 在 像 Java 这 样 纯 粹 的 面 向 对 象 语 言 中, 所 有
玩 转 Object 不 理 解, 就 无 法 真 正 拥 有 歌 德 按 其 实 而 审 其 名, 以 求 其 情 ; 听 其 言 而 查 其 累, 无 使 放 悖 ( 根 据 实 际 明 辨 名 称, 以 便 求 得 真 实 情 况 ; 听 取 言 辞 后 弄 明 它 的 类 别, 不 让 它 混 淆 错 乱 ) 三 玩 转 Object 大 围 山 人 玩 转 Object...1 1. 通
一 個 SQL Injection 實 例 的 啟 示 頁 2 / 6 因 此, 在 知 名 網 站 上 看 到 SQL Injection, 讓 人 驚 心, 卻 不 意 外 網 站 專 案 外 包 是 目 前 業 界 的 常 態, 而 在 價 格 取 勝 的 制 度 下, 低 價 得 標 的 S
一 個 SQL Injection 實 例 的 啟 示 頁 1 / 6 你 的 網 站 在 裸 奔 嗎? 一 個 SQL Injection 實 例 的 啟 示 作 者 : 李 明 儒 SQL Injection( 資 料 隱 碼 攻 擊 ) 問 題 早 就 不 是 什 麼 新 聞, 但 前 陣 子 在 一 個 頗 具 知 名 度 的 活 動 網 站 上, 赫 然 發 現 它 大 刺 刺 地 現 身!
数 据 库 系 统 基 础 2/54 第 6 章 数 据 库 管 理 与 维 护
数 据 库 系 统 基 础 1/54 数 据 库 系 统 基 础 哈 尔 滨 工 业 大 学 2011.~2012. 数 据 库 系 统 基 础 2/54 第 6 章 数 据 库 管 理 与 维 护 数 据 库 系 统 基 础 3/54 第 6 章 数 据 库 管 理 与 维 护 6.1 数 据 库 管 理 员 的 基 本 职 责 6.2 数 据 库 存 储 与 性 能 管 理 6.3 数 据 库
<4D6963726F736F667420576F7264202D2031313939204A617661B7C3CECA53514C536572766572BEDDBFE2B5C4C9E8BCC6D3EBCAB5CFD62E646F63>
Java 访 问 SQL Server 数 据 库 的 设 计 与 实 现 Zhuojun Zhao 数 据 库 连 接 是 软 件 项 目 开 发 中 很 重 要 的 一 个 环 节, 但 是 很 多 Java 初 学 者 在 学 习 连 接 数 据 库 的 过 程 中 感 到 非 常 头 疼, 总 是 出 现 一 系 列 的 问 题, 不 是 连 接 错 误 报 异 常, 就 是 无 法 显 示
Symantec™ Sygate Enterprise Protection 防护代理安装使用指南
Symantec Sygate Enterprise Protection 防 护 代 理 安 装 使 用 指 南 5.1 版 版 权 信 息 Copyright 2005 Symantec Corporation. 2005 年 Symantec Corporation 版 权 所 有 All rights reserved. 保 留 所 有 权 利 Symantec Symantec 徽 标 Sygate
《面向对象程序设计A》课程教学大纲Ⅱ4
Java 程 序 设 计 课 程 教 学 大 纲 Ⅱ5 课 程 代 码 : 课 程 名 称 :Java 程 序 设 计 Java Programming 学 分 :5 总 学 时 :80 ( 其 中 : 理 论 学 时 :48 实 验 ( 上 机 ) 学 时 :32) 先 修 课 程 : 2106010190 大 学 计 算 机 信 息 技 术 基 础 适 用 对 象 : 本 二 工 科 非 计 算
提问袁小兵:
C++ 面 试 试 题 汇 总 柯 贤 富 管 理 软 件 需 求 分 析 篇 1. STL 类 模 板 标 准 库 中 容 器 和 算 法 这 部 分 一 般 称 为 标 准 模 板 库 2. 为 什 么 定 义 虚 的 析 构 函 数? 避 免 内 存 问 题, 当 你 可 能 通 过 基 类 指 针 删 除 派 生 类 对 象 时 必 须 保 证 基 类 析 构 函 数 为 虚 函 数 3.
Microsoft PowerPoint - course2.ppt
Java 程 式 設 計 基 礎 班 (2) 莊 坤 達 台 大 電 信 所 網 路 資 料 庫 研 究 室 Email: [email protected] Class 2 1 回 顧 Eclipse 使 用 入 門 Class 2 2 Lesson 2 Java 程 式 語 言 介 紹 Class 2 3 Java 基 本 知 識 介 紹 大 小 寫 有 差 (Case Sensitive)
上海市教育考试院关于印发新修订的
沪 教 考 院 社 考 2012 7 号 上 海 市 教 育 考 试 院 关 于 印 发 上 海 市 高 等 学 校 计 算 机 等 级 考 试 大 纲 (2012 年 修 订 ) 的 通 知 各 有 关 高 校 : 为 进 一 步 加 强 本 市 高 校 计 算 机 基 础 教 学 工 作, 推 进 学 校 更 加 科 学 合 理 地 设 置 计 算 机 基 础 课 程 及 安 排 教 学 内 容,
SiteView技术白皮书
SiteView ECC V6.2 技 术 白 皮 书 游 龙 网 络 科 技 ( 中 国 ) 有 限 公 司 DragonFlow Networks(China),Inc. 目 录 第 一 章 产 品 概 述... 3 第 二 章 系 统 结 构... 6 一 系 统 架 构... 7 1 用 户 管 理 模 块... 7 2 Web Server... 8 3 存 储 加 密 模 块... 8
untitled
http://idc.hust.edu.cn/~rxli/ 1.1 1.2 1.3 1.4 1.5 1.6 2 1.1 1.1.1 1.1.2 1.1.3 3 1.1.1 Data (0005794, 601,, 1, 1948.03.26, 01) (,,,,,) 4 1.1.1 Database DB 5 1.1.1 (DBMS) DDL ( Create, Drop, Alter) DML(
ebook45-4
4 T-SQL SQL Server S Q L 4.1 CAST CONVERT C A S T C O N V E RT C A S T CAST ( e x p r e s s i o n AS d a t a _ t y p e) e x p r e s s i o n SQL Server D a t a _ t y p e C A S T DECLARE @intva l u e SELECT
幻灯片 1
沈 阳 工 业 大 学 2014 年 6 月 第 7 章 数 据 库 技 术 基 础 主 要 内 容 : 7.1 数 据 库 概 述 数 据 库 基 本 概 念 数 据 模 型 逻 辑 数 据 模 型 数 据 库 系 统 的 产 生 和 发 展 常 用 的 数 据 库 管 理 系 统 7.2 Access 2010 数 据 库 创 建 及 维 护 创 建 Access 2010 数 据 库 创 建
ebook 96-16
16 13 / ( ) 16-1 SQL*Net/Net8 SQL*Net/Net8 SQL*Net/Net8 16-1 / S Q L SQL*Net V2 N e t 8 S Q L * N e t N e t ( ) 16.1 S Q L O r a c l e S Q L 16 401 ) ( H R _ L I N K create database link p u b l i c (
學 科 100% ( 為 單 複 選 題, 每 題 2.5 分, 共 100 分 ) 1. 請 參 閱 附 圖 作 答 : (A) 選 項 A (B) 選 項 B (C) 選 項 C (D) 選 項 D Ans:D 2. 下 列 對 於 資 料 庫 正 規 化 (Normalization) 的 敘
ITE 資 訊 專 業 人 員 鑑 定 資 料 庫 系 統 開 發 與 設 計 實 務 試 卷 編 號 :IDS101 注 意 事 項 一 本 測 驗 為 單 面 印 刷 試 題, 共 計 十 三 頁 第 二 至 十 三 頁 為 四 十 道 學 科 試 題, 測 驗 時 間 90 分 鐘 : 每 題 2.5 分, 總 測 驗 時 間 為 90 分 鐘 二 執 行 CSF 測 驗 系 統 -Client
chp6.ppt
Java 软 件 设 计 基 础 6. 异 常 处 理 编 程 时 会 遇 到 如 下 三 种 错 误 : 语 法 错 误 (syntax error) 没 有 遵 循 语 言 的 规 则, 出 现 语 法 格 式 上 的 错 误, 可 被 编 译 器 发 现 并 易 于 纠 正 ; 逻 辑 错 误 (logic error) 即 我 们 常 说 的 bug, 意 指 编 写 的 代 码 在 执 行
第 15 章 程 式 編 写 語 言 15.1 程 式 編 写 語 言 的 角 色 程 式 編 寫 語 言 是 程 式 編 寫 員 與 電 腦 溝 通 的 界 面 語 法 是 一 組 規 則 讓 程 式 編 寫 員 將 字 詞 集 合 起 來 電 腦 是 處 理 位 元 和 字 節 的 機 器, 與
程 式 編 写 語 言 在 完 成 這 章 後, 你 將 能 夠 了 解 程 式 編 写 語 言 的 功 能 了 解 高 階 語 言 和 低 階 語 言 之 間 的 分 別 知 道 翻 譯 程 式 的 意 義 和 能 夠 把 翻 譯 程 式 分 類 為 : 匯 編 程 式 編 譯 程 式 和 解 譯 程 式 認 識 不 同 翻 譯 程 式 的 優 點 和 缺 點 程 式 是 指 揮 電 腦 的 指
1 SQL Server 2005 SQL Server Microsoft Windows Server 2003NTFS NTFS SQL Server 2000 Randy Dyess DBA SQL Server SQL Server DBA SQL Server SQL Se
1 SQL Server 2005 DBA Microsoft SQL Server SQL ServerSQL Server SQL Server SQL Server SQL Server SQL Server 2005 SQL Server 2005 SQL Server 2005 o o o SQL Server 2005 1 SQL Server 2005... 3 2 SQL Server
9, : Java 19., [4 ]. 3 Apla2Java Apla PAR,Apla2Java Apla Java.,Apla,,, 1. 1 Apla Apla A[J ] Get elem (set A) A J A B Intersection(set A,set B) A B A B
25 9 2008 9 M ICROEL ECTRON ICS & COMPU TER Vol. 25 No. 9 September 2008 J ava 1,2, 1,2, 1,2 (1, 330022 ; 2, 330022) :,. Apla - Java,,.. : PAR ;Apla - Java ; ;CMP ; : TP311 : A : 1000-7180 (2008) 09-0018
<4D F736F F D D342DA57CA7DEA447B14D2DA475B57BBB50BADEB27AC3FEB14DA447B8D5C344>
1. 請 問 誰 提 出 積 體 電 路 (IC) 上 可 容 納 的 電 晶 體 數 目, 約 每 隔 24 個 月 (1975 年 更 改 為 18 個 月 ) 便 會 增 加 一 倍, 效 能 也 將 提 升 一 倍, 也 揭 示 了 資 訊 科 技 進 步 的 速 度? (A) 英 特 爾 (Intel) 公 司 創 始 人 戈 登. 摩 爾 (Gordon Moore) (B) 微 軟 (Microsoft)
Microsoft Word - PS2_linux_guide_cn.doc
Linux For $ONY PlayStatioin2 Unofficall General Guide Language: Simplified Chinese First Write By Beter Hans v0.1 Mail: [email protected] Version: 0.1 本 人 是 菜 鸟 + 小 白 欢 迎 指 正 错 误 之 处, 如 果 您 有 其 他 使 用 心 得
ebook204-2
Internet Information Services 2 I I S 5 We b We b I I S IIS 5 M i c r o s o f t M i c r o s o f t Active Server Pages A S P We b IIS 5 IIS 5 3 We b IIS 5 We b Microsoft Solutions Framework M S F M S F
XXXXXXXX http://cdls.nstl.gov.cn 2 26
[ ] [ ] 2003-7-18 1 26 XXXXXXXX http://cdls.nstl.gov.cn 2 26 (2003-7-18) 1...5 1.1...5 1.2...5 1.3...5 2...6 2.1...6 2.2...6 2.3...6 3...7 3.1...7 3.1.1...7 3.1.2...7 3.1.2.1...7 3.1.2.1.1...8 3.1.2.1.2...10
科学计算的语言-FORTRAN95
科 学 计 算 的 语 言 -FORTRAN95 目 录 第 一 篇 闲 话 第 1 章 目 的 是 计 算 第 2 章 FORTRAN95 如 何 描 述 计 算 第 3 章 FORTRAN 的 编 译 系 统 第 二 篇 计 算 的 叙 述 第 4 章 FORTRAN95 语 言 的 形 貌 第 5 章 准 备 数 据 第 6 章 构 造 数 据 第 7 章 声 明 数 据 第 8 章 构 造
全国计算机技术与软件专业技术资格(水平)考试
全 国 计 算 机 技 术 与 软 件 专 业 技 术 资 格 ( 水 平 ) 考 试 2008 年 上 半 年 程 序 员 下 午 试 卷 ( 考 试 时 间 14:00~16:30 共 150 分 钟 ) 试 题 一 ( 共 15 分 ) 阅 读 以 下 说 明 和 流 程 图, 填 补 流 程 图 中 的 空 缺 (1)~(9), 将 解 答 填 入 答 题 纸 的 对 应 栏 内 [ 说 明
<4D6963726F736F667420576F7264202D20BBB7BEB3D0C5CFA2CFB5CDB3CAFDBEDDBFE2B7C3CECABDD3BFDAB9E6B7B6A3A8B1A8C5FAB8E5A3A93731392E646F63>
HJ 719-2014 环 境 信 息 系 统 数 据 库 访 问 接 口 规 范 Specification for database access interface of environment information system ( 发 布 稿 ) 本 电 子 版 为 发 布 稿 请 以 中 国 环 境 科 学 出 版 社 出 版 的 正 式 标 准 文 本 为 准 2014-12-25
untitled
II III IV V VI VII VIII IX 2 ASP 1 ASP 3 4 ASP Web CGI ISAPI OLEISAPI Perl IDC ASP dbweb Perl IDC ASP dbweb IDC 1 ASP 5 Web Web DLL 6 ASP 1 ASP 7 8 ASP 1 ASP 9 10 ASP 1 ASP 11 12 ASP 1 ASP 13 14 ASP 1
内 容 提 要 将 JAVA 开 发 环 境 迁 移 到 Linux 系 统 上 是 现 在 很 多 公 司 的 现 实 想 法, 而 在 Linux 上 配 置 JAVA 开 发 环 境 是 步 入 Linux 下 JAVA 程 序 开 发 的 第 一 步, 本 文 图 文 并 茂 地 全 程 指
内 容 提 要 将 JAVA 开 发 环 境 迁 移 到 Linux 系 统 上 是 现 在 很 多 公 司 的 现 实 想 法, 而 在 Linux 上 配 置 JAVA 开 发 环 境 是 步 入 Linux 下 JAVA 程 序 开 发 的 第 一 步, 本 文 图 文 并 茂 地 全 程 指 导 你 搭 建 Linux 平 台 下 的 JAVA 开 发 环 境, 包 括 JDK 以 及 集
f2.eps
前 言, 目 录 产 品 概 况 1 SICAM PAS SICAM 电 力 自 动 化 系 统 配 置 和 使 用 说 明 配 置 2 操 作 3 实 时 数 据 4 人 机 界 面 5 SINAUT LSA 转 换 器 6 状 态 与 控 制 信 息 A 版 本 号 : 08.03.05 附 录, 索 引 安 全 标 识 由 于 对 设 备 的 特 殊 操 作 往 往 需 要 一 些 特 殊 的
ME3208E2-1.book
DocuPrint 205/255/305 操 作 說 明 書 Adobe Adobe logo PostScript PostScript 3 及 PostScript logo 是 Adobe Systems Incorporated 的 商 標 Microsoft Windows Windows NT Windows Server 是 美 國 Microsoft Corporation 於 美
untitled
653 JAVA 2008 11 Institution of Software Engineer... 2... 4... 4... 5... 5... 8... 8... 8... 8... 8... 9... 9... 9... 11... 13... 13... 13... 13... 15... 15... 15... 15... 16... 16... 17... 17... 17...
A API Application Programming Interface 见 应 用 程 序 编 程 接 口 ARP Address Resolution Protocol 地 址 解 析 协 议 为 IP 地 址 到 对 应 的 硬 件 地 址 之 间 提 供 动 态 映 射 阿 里 云 内
A API Application Programming Interface 见 应 用 程 序 编 程 接 口 ARP Address Resolution Protocol 地 址 解 析 协 议 为 IP 地 址 到 对 应 的 硬 件 地 址 之 间 提 供 动 态 映 射 阿 里 云 内 容 分 发 网 络 Alibaba Cloud Content Delivery Network 一
二 Synchronized 1. Java 语 言 的 关 键 字, 当 它 用 来 修 饰 一 个 方 法 或 者 一 个 代 码 块 的 时 候, 能 够 保 证 在 同 一 时 刻 最 多 只 有 一 个 线 程 执 行 该 段 代 码 2. 当 两 个 并 发 线 程 访 问 同 一 个
Java 基 础 包 括 多 线 程 (Thread 和 Runable 的 区 别 ) 同 步 异 步 (Synchronized) 线 程 池 集 合 序 列 化 反 射 实 例 化 过 程 JDBC 常 用 类 IBatis Java 类 生 命 周 期 Java Web 生 命 周 期 Tomcat 出 去 Http 请 求 过 程 Java 垃 圾 回 收 机 制 Java 性 能 优 化
入學考試網上報名指南
入 學 考 試 網 上 報 名 指 南 On-line Application Guide for Admission Examination 16/01/2015 University of Macau Table of Contents Table of Contents... 1 A. 新 申 請 網 上 登 記 帳 戶 /Register for New Account... 2 B. 填
13 根 据 各 种 网 络 商 务 信 息 对 不 同 用 户 所 产 生 的 使 用 效 用, 网 络 商 务 信 息 大 致 可 分 为 四 级, 其 中 占 比 重 最 大 的 是 ( A ) A 第 一 级 免 费 信 息 B 第 二 级 低 收 费 信 息 C 第 三 级 标 准 收 费
助 理 电 子 商 务 考 试 真 题 试 题 第 一 部 分 : 理 论 部 分 一 单 项 选 择 题 1 ( B ) 是 信 息 系 统 的 核 心 组 成 部 分 A 逻 辑 模 型 B 数 据 库 C 概 念 模 型 D 以 上 全 部 2 ping www.163.com -t 中 参 数 t 的 作 用 是 :( A ) A 进 行 连 续 测 试 B 在 新 窗 口 中 显 示 C
詞 彙 表 編 號 詞 彙 描 述 1 預 約 人 資 料 中 文 姓 名 英 文 姓 名 身 份 證 字 號 預 約 人 電 話 性 別 2 付 款 資 料 信 用 卡 別 信 用 卡 號 信 用 卡 有 效 日 期 3 住 房 條 件 入 住 日 期 退 房 日 期 人 數 房 間 數 量 入
100 年 特 種 考 試 地 方 政 府 公 務 人 員 考 試 試 題 等 別 : 三 等 考 試 類 科 : 資 訊 處 理 科 目 : 系 統 分 析 與 設 計 一 請 參 考 下 列 旅 館 管 理 系 統 的 使 用 案 例 圖 (Use Case Diagram) 撰 寫 預 約 房 間 的 使 用 案 例 規 格 書 (Use Case Specification), 繪 出 入
Microsoft Word - 11.doc
除 錯 技 巧 您 將 於 本 章 學 到 以 下 各 項 : 如 何 在 Visual C++ 2010 的 除 錯 工 具 控 制 下 執 行 程 式? 如 何 逐 步 地 執 行 程 式 的 敘 述? 如 何 監 看 或 改 變 程 式 中 的 變 數 值? 如 何 監 看 程 式 中 計 算 式 的 值? 何 謂 Call Stack? 何 謂 診 斷 器 (assertion)? 如 何
高 职 计 算 机 类 优 秀 教 材 书 目 * 序 号 书 号 (ISBN) 书 名 作 者 定 价 出 版 / 印 刷 日 期 ** 配 套 资 源 页 码 计 算 机 基 础 课 1 978-7-111-30658-0 计 算 机 应 用 基 础 刘 升 贵 29.00 2012 年 8 月
高 职 计 算 机 类 优 秀 教 材 书 目 * 序 号 书 号 (ISBN) 书 名 作 者 定 价 出 版 / 印 刷 日 期 ** 配 套 资 源 页 码 计 算 机 基 础 课 1 978-7-111-30658-0 计 算 机 应 用 基 础 刘 升 贵 29.00 2012 年 8 月 电 子 教 案 P1 2 978-7-111-27081-2 计 算 机 应 用 基 础 ( 第 2
VB程序设计教程
高 等 学 校 教 材 Visual Basic 程 序 设 计 教 程 魏 东 平 郑 立 垠 梁 玉 环 石 油 大 学 出 版 社 内 容 提 要 本 书 是 按 高 等 学 校 计 算 机 程 序 设 计 课 程 教 学 大 纲 编 写 的 大 学 教 材, 主 要 包 括 VB 基 础 知 识 常 用 程 序 结 构 和 算 法 Windows 用 户 界 面 设 计 基 础 文 件 处
Acrobat Distiller, Job 3
逢 甲 大 學 資 訊 工 程 學 系 專 題 電 子 商 務 金 融 系 統 The Financial System for Electronic Commerce 指 導 教 授 : 李 維 斌 博 士 [email protected] 逢 甲 大 學 資 訊 工 程 學 系 學 生 : 曾 政 國 [email protected] 逢 甲 大 學 資 訊 工 程 學 系 中 華 民 國
chp1
Java 软 件 设 计 基 础 1. Java 概 述 课 程 参 考 书 目 Java 程 序 设 计 及 应 用 开 发 教 程, 虞 益 诚 主 编, 科 学 出 版 社 Java 教 程,Sharon Zakhour, 人 民 邮 电 出 版 社 Introduction to Java Programming,Y.Daniel Liang, 机 械 工 业 出 版 社 Java 编 程
多層次傳銷與獎金系統
醒 吾 技 術 學 院 資 訊 管 理 系 ( 五 專 部 ) 九 十 六 學 年 度 畢 業 專 題 多 層 次 傳 銷 與 獎 金 系 統 組 員 : 921506122 游 濬 瑋 921506126 陳 彥 宇 921506139 林 龍 華 921506144 陳 昶 志 921506149 楊 璧 如 指 導 老 師 : 汪 淵 老 師 中 華 民 國 九 十 七 年 一 月 十 一 醒
目 录 简 介.3 ` 体 系 结 构...4 数 据 层...5 数 据 连 接 器...6 Tableau Server 组 件...7 网 关 / 负 载 平 衡 器...8 客 户 端 :Web 浏 览 器 和 移 动 应 用 程 序...8 客 户 端 :Tableau Desktop..
Neelesh Kamkolkar, 产 品 经 理 Ellie Fields, 产 品 营 销 副 总 裁 Marc Rueter, 战 略 解 决 方 案 高 级 总 监 适 用 于 企 业 的 Tableau: IT 概 述 目 录 简 介.3 ` 体 系 结 构...4 数 据 层...5 数 据 连 接 器...6 Tableau Server 组 件...7 网 关 / 负 载 平 衡
建 立 数 据 库 档 案 用 sqlite3 建 立 数 据 库 的 方 法 很 简 单, 只 要 在 shell 下 键 入 ( 以 下 $ 符 号 为 shell 提 示 号, 请 勿 键 入 ): $ sqlite3 foo.db 如 果 目 录 下 没 有 foo.db,sqlite3 就
Sqlite3 使 用 教 程 OS X 自 从 10.4 后 把 SQLite 这 套 相 当 出 名 的 数 据 库 软 件, 放 进 了 作 业 系 统 工 具 集 里 OS X 包 装 的 是 第 三 版 的 SQLite, 又 称 SQLite3 这 套 软 件 有 几 个 特 色 : 软 件 属 于 公 共 财 (public domain),sqlite 可 说 是 某 种 美 德 软
(CIP) Web /,. :,2005. 1 ISBN 7 81058 782 X.W............T P393.4 CIP (2004) 118797 Web ( 99 200436) ( http:/ / www.shangdapress.com 66135110) : * 787
Web (CIP) Web /,. :,2005. 1 ISBN 7 81058 782 X.W............T P393.4 CIP (2004) 118797 Web ( 99 200436) ( http:/ / www.shangdapress.com 66135110) : * 787 1092 1/ 16 30.75 748 2005 1 1 2005 1 1 : 1 3 100
《计算机导论》实验教学大纲
计 算 机 科 学 与 技 术 专 业 实 验 教 学 大 纲 福 建 师 范 大 学 数 学 与 计 算 机 科 学 学 院 2012 年 6 月 目 录 1. 计 算 机 导 论 教 学 大 纲... 3 2. 高 级 语 言 程 序 设 计 教 学 大 纲...5 3. 数 据 结 构 教 学 大 纲... 8 4. 算 法 设 计 与 分 析 ( 计 本 ) 教 学 大 纲...10 5.
《大话设计模式》第一章
第 1 章 代 码 无 错 就 是 优? 简 单 工 厂 模 式 1.1 面 试 受 挫 小 菜 今 年 计 算 机 专 业 大 四 了, 学 了 不 少 软 件 开 发 方 面 的 东 西, 也 学 着 编 了 些 小 程 序, 踌 躇 满 志, 一 心 要 找 一 个 好 单 位 当 投 递 了 无 数 份 简 历 后, 终 于 收 到 了 一 个 单 位 的 面 试 通 知, 小 菜 欣 喜
Microsoft Word - 100118002.htm
100 年 度 11800 電 腦 軟 體 應 用 乙 級 技 術 士 技 能 檢 定 學 科 測 試 試 題 本 試 卷 有 選 擇 題 80 題, 每 題 1.25 分, 皆 為 單 選 選 擇 題, 測 試 時 間 為 100 分 鐘, 請 在 答 案 卡 上 作 答, 答 錯 不 倒 扣 ; 未 作 答 者, 不 予 計 分 准 考 證 號 碼 : 姓 名 : 選 擇 題 : 1. (3)
JAVA编码规范
JAVA 编 码 规 范 为 什 么 要 有 编 码 规 范? 编 码 规 范 对 于 程 序 员 而 言 尤 为 重 要, 有 以 下 几 个 原 因 : - 一 个 软 件 的 生 命 周 期 中,80% 的 花 费 在 于 维 护 - 几 乎 没 有 任 何 一 个 软 件, 在 其 整 个 生 命 周 期 中, 均 由 最 初 的 开 发 人 员 来 维 护 - 编 码 规 范 可 以 改
第1章 QBASIC语言概述
第 3 章 网 络 安 全 学 习 目 的 (1) 了 解 计 算 机 网 络 安 全 的 基 础 知 识 (2) 熟 悉 网 络 安 全 防 范 的 措 施 与 目 标 (3) 了 解 计 算 机 病 毒 的 基 础 知 识 (4) 掌 握 计 算 机 病 毒 的 预 防 检 测 与 清 除 方 法 学 习 重 点 与 难 点 (1) 网 络 安 全 防 范 措 施 (2) 计 算 机 病 毒 的
<4D6963726F736F667420576F7264202D20383439342D352DBED6D3F2CDF8D7E9BDA8D3EBB9DCC0EDCFEEC4BFBDCCB3CCD5FDCEC42E646F63>
第 4 单 元 搭 建 自 己 的 Web 站 点 本 单 元 通 过 学 习 架 构 Web 服 务 器, 实 现 Web 服 务, 管 理 Web 站 点, 了 解 Web 站 点 服 务 器 的 架 构 个 人 空 间 和 虚 拟 主 机 的 概 念, 掌 握 IIS 组 件 的 安 装 Web 站 点 的 创 建 管 理 站 点 属 性 选 项 卡 的 配 置 管 理 等 知 识,Web 网
(procedure-oriented)?? 2
1 (procedure-oriented)?? 2 (Objected-Oriented) (class)? (method)? 3 : ( 4 ???? 5 OO 1966 Kisten Nygaard Ole-Johan Dahl Simula Simula 爲 6 Smalltalk Alan Kay 1972 PARC Smalltalk Smalltalk 爲 Smalltalk 爲 Smalltalk
CANVIO_AEROCAST_CS_EN.indd
简 体 中 文...2 English...4 SC5151-A0 简 体 中 文 步 骤 2: 了 解 您 的 CANVIO AeroCast CANVIO AeroCast 无 线 移 动 硬 盘 快 速 入 门 指 南 欢 迎 并 感 谢 您 选 择 TOSHIBA 产 品 有 关 您 的 TOSHIBA 产 品 的 详 情, 请 参 阅 包 含 更 多 信 息 的 用 户 手 册 () 安
經濟統計資料庫管理資訊系統
招 標 文 件 (1) 經 濟 部 投 資 審 議 委 員 會 全 球 投 資 審 議 管 理 資 訊 系 統 ( 第 3 期 ) 開 發 建 置 專 案 投 標 須 知 經 濟 部 投 資 審 議 委 員 會 中 華 民 國 95 年 2 月 經 濟 部 投 資 審 議 委 員 會 投 標 須 知 以 下 各 項 招 標 規 定 內 容, 由 機 關 填 寫, 投 標 廠 商 不 得 填 寫 或
Microsoft PowerPoint - Ch6
第 六 章 基 本 的 SQL 目 的 SQL 的 關 聯 模 式 SQL 的 資 料 定 義 語 言 CREATE TABLE DROP TABLE ALTER TABLE 基 本 的 SQL 查 詢 SELECT FROM WHERE SQL 的 更 新 INSERT UPDATE DELETE 6-1 目 的 關 聯 模 式 定 義 嚴 謹 簡 潔, 但 好 用 性 和 執 行 效 率 必 須
CH01.indd
3D ios Android Windows 10 App Apple icloud Google Wi-Fi 4G 1 ( 3D ) 2 3 4 5 CPU / / 2 6 App UNIX OS X Windows Linux (ios Android Windows 8/8.1/10 BlackBerry OS) 7 ( ZigBee UWB) (IEEE 802.11/a/b/g/n/ad/ac
教案模板4-2
传 智 播 客 ASP.NET 就 业 实 例 教 程 教 学 设 计 课 程 名 称 :ASP.NET 就 业 实 例 教 程 授 课 年 级 : 2015 年 级 授 课 学 期 : 2015 学 年 第 二 学 期 教 师 姓 名 : 某 某 老 师 2015 年 02 月 02 日 课 题 名 称 第 2 章 ADO.NET 计 划 学 时 6 课 时 内 容 分 析 教 学 目 标 及 基
Oracle Database 10g: SQL (OCE) 的第一堂課
商 用 資 料 庫 的 第 一 堂 課 中 華 大 學 資 訊 管 理 系 助 理 教 授 李 之 中 http://www.chu.edu.tw/~leecc 甲 骨 文 俱 樂 部 @Taiwan Facebook 社 團 https://www.facebook.com/groups/365923576787041/ 2014/09/15 問 題 一 大 三 了, 你 為 什 麼 還 在 這
201406002+大学计算机基础B.doc
目 录. 大 学 计 算 机 基 础 B( 非 独 立 设 课 ).... 计 算 机 操 作 基 础 ( 独 立 设 课 )...3 3. 程 序 设 计 基 础 ( 非 独 立 设 课 )...5 4. 面 向 对 象 程 序 设 计 ( 非 独 立 设 课 )...8 5. 数 据 库 原 理 ( 非 独 立 设 课 )...0 6. 算 法 设 计 与 分 析 ( 非 独 立 设 课 )...
GoFlex Home UG Book.book
FreeAgent GoFlex Home 用 户 指 南 FreeAgent GoFlex Home 用 户 指 南 2011 Seagate Technology LLC. 保 留 所 有 权 利 Seagate Seagate Technology Wave 徽 标 及 FreeAgent 是 Seagate Technology LLC 或 其 某 个 子 公 司 的 商 标 或 注 册 商
