?? demo.java
字號:
import java.sql.*;
public class demo{
public static void main (String s[])
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:eris","eris","eris");
Statement st= con.createStatement();
PreparedStatement pst=con.prepareStatement("update applicantsdetails set firstname=? where applicantid=4002");
ResultSet rs=st.executeQuery("select * from applicantsdetails where applicantid=4002");
if(rs.next())
{
System.out.println(rs.getString(1));
System.out.println(rs.getString("firstname"));
}
pst.setString(1,"adi");
pst.executeUpdate();
}catch(Exception e)
{
System.out.println( "cause"+e.getCause().toString());
}
finally()
{
rs.close();
st.close();
pst.close();
con.close();
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -