String csql="insert into yasj(id,name_t,num,type)values('f','','s')";
do you know?
if this sql is successfully executed, name_t will not be null, but a '' string
modify it as following
String csql="insert into yasj(id,name_t,num,type) values('f',null,'s')";
or
String csql="insert into yasj(id,num,type) values('f','s')";int i=zxsql(csql);
if (i>0)
out.print("成功")!;
else
out.print("不成功")!;
请问这里要怎么样控制,请指教!·!!!!!
how do you design your function zxsql?
do you know?
if this sql is successfully executed, name_t will not be null, but a '' string
modify it as following
String csql="insert into yasj(id,name_t,num,type) values('f',null,'s')";
or
String csql="insert into yasj(id,num,type) values('f','s')";int i=zxsql(csql);
if (i>0)
out.print("成功")!;
else
out.print("不成功")!;
请问这里要怎么样控制,请指教!·!!!!!
how do you design your function zxsql?
解决方案 »
- 请教牛顿迭代法的C++的实现程序
- “利用Ajax自动完成功能”怎么用?
- 项目结尾,要做日志记录 写入数据库表
- Tomcat6.0安装问题!
- 编译时出现org.apache.jasper.JasperException: Exception in JSP: /index.jsp:11
- ResultSet的使用?
- Netbeans上传组件???????
- utf-8编码页面的中文与fileupload组件结合的问题,请帮我
- Cannot forward after response has been committed是怎么回事?
- 当我把javascript写成一个js文件后,在其他文件中该怎样调用?
- 文件格式转换
- fileupload 上传问题:存取被拒。大家帮忙,被上传折磨两天了(请参考源代码) 如果提供详有用的帮助,可以马上结贴或加分!
String csql="insert into yasj(id,name_t,num,type) values('f',null,'','s')";
or
String csql="insert into yasj(id,num,type) values('f','','s')";
具体如下:insert into yasj(id,,num,type)values('f','d','s')
或insert into yasj(id,name_t,num,type)values('f','','d','s')
那个没有关系,
我多写了一个,但是就像JavaJspServlet()说的一样,
这个东西insert into yasj(id,name_t,num,type)values('f','','d','s')JSP里他就说添加不成功,
不明白,但是SQL语句是允许空值的,在JSP里面就不可以,!
public int zxsql(String csql) {
int i=0;
try {
Class.forName(DBDriver);
}
catch(java.lang.ClassNotFoundException e) {
System.err.println("jdbc for odbc的驱动不存在");
i=0;
}
try {
cn = DriverManager.getConnection(cnstr);
java.sql.Statement st = cn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
i=st.executeUpdate(csql);
}
catch(SQLException ex) {
System.err.println("执行语句错误或连接已断开");
} return i;
}
%>这个是这样写的
speak chinese
please change ResultSet.CONCUR_READ_ONLY to be ResultSet.CONCUR_UPDATABLE
i do not understand 不明白,但是SQL语句是允许空值的,在JSP里面就不可以,!
and 但是现在我必须所有的参数都必须有值,一个为空都不能添加成功!
what is your 参数, and where and how do you use it in your code?