e1704.java

来自「java小程序」· Java 代码 · 共 33 行

JAVA
33
字号
import java.sql.*;
public class E1704
{
public static void main(String args[])
{
String[] tel={"(07)3333333","(07)4444444"};
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(ClassNotFoundException e)
{
System.out.println(e.getMessage());
}
try
{
Connection con=DriverManager.getConnection("jdbc:odbc:bookbase");
Statement stmt=con.createStatement();
PreparedStatement pstmt=con.prepareStatement("delete name from mailTab where tel =?");
for(int i=0;i<tel.length;i++)
{
pstmt.setString(1,tel[i]);
pstmt.executeUpdate();
}
stmt.close();
con.close();
}
catch(SQLException ex)
{
System.out.println("SQLException:"+ex.getMessage());
}
}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?