在Java语言中,下列( )是正确的JDBC代码片断.A.PreparedStatement pstme=con.prepareStatement(“insert into EMP(EMPNO,ENAME)values(?,)”);Pstmt.setInt(1,7);Pstmt.setString(2,”Admin”);B.PreparedStatement pstme=con.prepareStatement(
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/24 02:14:08
在Java语言中,下列( )是正确的JDBC代码片断.A.PreparedStatement pstme=con.prepareStatement(“insert into EMP(EMPNO,ENAME)values(?,)”);Pstmt.setInt(1,7);Pstmt.setString(2,”Admin”);B.PreparedStatement pstme=con.prepareStatement(
在Java语言中,下列( )是正确的JDBC代码片断.
A.PreparedStatement pstme=con.prepareStatement(“insert into EMP
(EMPNO,ENAME)values(?,)”);
Pstmt.setInt(1,7);
Pstmt.setString(2,”Admin”);
B.PreparedStatement pstme=con.prepareStatement(“insert into EMP
(EMPNO,ENAME)values(?,)”);
Pstmt.setInt(1,”7”);
Pstmt.setString(2,”Admin”);
C.Statement stmt=con.createStatement(“insert into EMP(EMPNO,ENAME)values(7,’Adnmin’));
D.PreparedStatemen stmtl=con.prepareStatement(“insertintoEMP(EMPNO,ENAME)values(7,’Amin’));
-----------------------------------------------------------------
应该选哪个?并且说明为什么.
D选项错在哪了?
在Java语言中,下列( )是正确的JDBC代码片断.A.PreparedStatement pstme=con.prepareStatement(“insert into EMP(EMPNO,ENAME)values(?,)”);Pstmt.setInt(1,7);Pstmt.setString(2,”Admin”);B.PreparedStatement pstme=con.prepareStatement(
A是对的,D是不是印错的insertintoEMP哪能这样写?
单词和单词间要有空格啊
C中EMPNO是个int类型的值,不能加双引号
只有A是对的