}catch (java.lang.ClassNotFoundException e) {
out.println("driver not found");
System.out.println("driver "+e);
}
try{
Statement stmt = c.createStatement();
String updateString = "insert into test values('"+ text +"')";
int count = stmt.executeUpdate(updateString);
ResultSet rs = stmt.executeQuery( "select text from test");
while(rs.next()){
String s = rs.getString("t");
out.println("<BR> <STRONG>Text from database:</STRONG>");
out.println(s);
}
rs.close();
stmt.close();
c.close();
}catch (java.lang.ClassNotFoundException e) {
out.println("driver not found");
System.out.println("driver "+e);
}
try{
Statement stmt = c.createStatement();
String updateString = "insert into test values('"+ text +"')";
int count = stmt.executeUpdate(updateString);
ResultSet results = stmt.executeQuery( "select t from test");
while(results.next()){
String s = results.getString("t");
out.println("<BR> <STRONG>Text from database:</STRONG>");
out.println(s);
}
rs.close();
stmt.close();
c.close();
to 楼上: 不行
启动tomcat时报了一堆错
WebappClassLoader: Additional JARs have been added
Apache Tomcat/4.0.1
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:112)
at java.util.jar.JarFile.<init>(JarFile.java:117)
at java.util.jar.JarFile.<init>(JarFile.java:82)