gqkly 2016-10-07 12:06 采纳率: 33.3%
浏览 1499
已采纳

相同语句数据库直接查询返回结果.用myeclipse查找不到列

前提:

数据库表:
+----------+--------+-------------+-----------+----------+
| IndexID1 | UserID | LoginStatus | Longitude | Latitude |
+----------+--------+-------------+-----------+----------+
| 1 | 1 | 离线 | 116.23 | 39.542 |
| 2 | 2 | 离线 | 10.11112 | 19.1111 |
+----------+--------+-------------+-----------+----------+

直接查询语句与结果:

mysql> select Latitude,Longitude from UserLoginTable where UserID='2';
+----------+-----------+
| Latitude | Longitude |
+----------+-----------+
| 19.1111 | 10.11112 |
+----------+-----------+
1 row in set

通过**myeclipse**编程查询部分代码:
String sql =null ;
ResultSet rs = null;
//先获取用户自身的坐标

sql ="select Longitude , latitude from UserLoginTable where UserID='"+userID+"'";

System.out.println(sql);

rs = DBUtil.queryData(sql);
结果:

select Longitude , latitude from UserLoginTable where UserID='2'
java.sql.SQLException: Column 'latitue' not found.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910)
at com.mysql.jdbc.ResultSet.findColumn(ResultSet.java:970)
at com.mysql.jdbc.ResultSet.getString(ResultSet.java:5613)
.....

注意看:
'latitue'并不是我写的查询语句中的内容'latitude'.

    补充:
     | Longitude | Latitude |
    两列是在之后添加的
    不知道要不要更新myeclipse的什么东西?
  • 写回答

7条回答

  • 阮二 2016-10-07 23:22
    关注

    1:检查 列名称是不是写错 不要要相信自己 这个和ide绝逼没关系
    2:数据库事物提交了没有
    3:先用 select * from 查一下 对应的列的数据有没有出来

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(6条)

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)
  • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。