2024年3月26日发(作者:)
Java编程中常见的错误有哪些?
sql错误
找不到列
Unknown column „fillMen‟ in „field list‟
2.列名在sql语句中写了2次
Column „fillMan‟ specified twice
3.下面2条 数据库插入对应的列都是int类型的 所插入的数据类型不符合要求时报错
Data truncated for column „gatheringMoney‟ at row 1
Data truncation: Out of range value adjusted for column „amount‟ at row 1
4.
Mixing of GROUP columns (MIN(),MAX(),COUNT(),…) with no GROUP columns is illegal if there is
no GROUP BY clause
5.修改一个表时无法取得同一个表的数据
ERROR 1093 (HY000): You can‟t specify target table „context‟ for update in FROM
clause
6.主键 未自动增长
ERROR 1062 :
类型字符过长
ataException: ‟2.5026744582E10′ in column ‟1′ is outside
valid range for the datatype INTEGER.
8.没找到错误 没影响数据读取
eption: Operation not allowed after ResultSet closed
9.类型错误 最常见的是数字类型错误
Data truncated for column „gatheringMoney‟ at row 1
10.换另一个项目时 数据库连接池没换 (未解)
Name java: is not bound in this Context
换了之后 似乎还是不行
=====
java:/comp/env/jdbc/ConnSqlSer
前面多了一个‟/‟
应为java:comp/env/jdbc/ConnSqlSer
=======
11.(未解)
eption: QueryRunner requires a DataSource to be invoked in this way, or a
Connection should be passed in
eQuery()方法改成execute()(未解)
Can not issue data manipulation statements with executeQuery().
Can not issue data manipulation statements with executeQuery().
struts错误
Failed to obtain specified collection 下拉框没值
警告: No FormBeanConfig found under „yuanLiaoRuKuForm‟ 配置文件Form出错
Cannot find bean: “” in any scope
< html:text >标签外面没有嵌套
No getter method for property: “outDate” of bean:
“aoPandianForm”
在form里面没有定义 此字段的get方法
Cannot get a connection, pool error Timeout waiting for idle object 数据库错误
Operation not allowed after ResultSet closed 可能是结果集关闭了
//在Action里面调用的DAO类 没有进行重新实例化
2008-5-12 20:02:09 tProcessor processException
警告: Unhandled Exception thrown: class interException
2008-5-12 20:02:09 rdWrapperValve invoke
严重: e() for servlet action threw exception
interException
at edCheckAdd(:151)
at 0(Native Method)
//在C标签里从一个对象里取值时 , 所请求的是对象里没有的属性
An error occurred while evaluating custom action attribute “value” with value
“${eAmount}”: Unable to find a value for “storageAmount” in object of class
“ed” using operator “.” (null)
forward 转向 连接到了一个还没开始写的action里面 而那个action所对应的jsp页面还没改
Resources cannot be null.
找不到下面这个action
Cannot retrieve mapping for action /finished/finishedChuKuSearch
Cannot retrieve mapping for action /purveyAdd 如果把jsp页面的action写错了 就这样报
/jspfinance/client/ShouKuanJiLu_(172,0) The end tag “
类型转换错误 一般是参数类型写错 在公共方法或者配置文件里面找
ingForm
eForm
struts标签里面 写进了html标签内的属性
/jspclient/KeHuDangAn_(44,88) equal symbol expected
/jspfinance/client/TuiHuanHuo_(70,42) quote symbol expected
/jspstorage/material/YuanLiaoChuKu_(84,31) equal symbol expected
Exception: /scDept/(333,167) equal symbol expected
jsp页面上action写错了
Cannot retrieve mapping for action /finished/finishedCheckAdd
配置文件出错
The content of element type “action-mappings” must match “(action)*”.
java常见错误以及可能原因集锦
2008-07-08 15:550、 需要标识符
a) 不在函数内
1、 非法表达式开始
b) 可能:丢失括号 .
2. no data found
a) 可能:setInt(1,100)中,没有100这个值
3. 找不到符号
a) 可能:没导入包
cannot be cast to
发布评论