📄 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();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -