java +jsp 手机端接口学习

最近几天一直在学习怎么给手机写接口,手机端应用已经写了三年多了,所以自己也想弄弄服务器客户端,下面就把自己的一些遇到问题总结如下

 

第一次访问 java +jsp 做的数据

1、老是404 一定是路径不对

2、数据库夹在驱动 有问题  那就是 //登记JDBC驱动程序

  try{

   Class.forName("com.mysql.jdbc.Driver") ;

   System.out.println("成功加载MySQL驱动程序");

  }catch(ClassNotFoundException e){

   e.printStackTrace() ;

   System.out.println("Class Not Found Exception . ") ;

  }

3、数据库密码一定要有,不然也会访问不成功的

 

4、数据库语句出错 

 sql=select * from userInfo where username=yang and userpsw=111111

sql=select * from userInfo where username= 'yang' and userpsw= '111111'

 

5、坑爹的包的导入 

想想服务器导入 json包的时候,位置没有导在WebContent/WEB-INF/lib下,而是他的再下一个目录,导致了

一直报错 java.lang.ClassNotFoundException: net.sf.json.JSONObject

所以以后一定要把第三方 jar导入到lib下面 

 

posted @ 2016-07-29 10:11  ios_Yang_技术博客  阅读(169)  评论(0)    收藏  举报