首页 星云 工具 资源 星选 资讯 热门工具
:

PDF转图片 完全免费 小红书视频下载 无水印 抖音视频下载 无水印 数字星空

servlet+jdbc实现微信公众号开发 源码下载

后端 2.76MB 35 需要积分: 1
立即下载

资源介绍:

原生servlet+jdbc实现微信公众号开发,包含自定义菜单等。
package com.eastnet.wechat.utils; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import com.mysql.jdbc.StringUtils; public class OperatorUtil { /** * 获取账号绑定状态 * @param fromUserName * @return */ public String getBindStatus(String fromUserName){ Connection conn=null; PreparedStatement ps=null; ResultSet rs=null; conn=new DBCPConnection().getConnection(); String selectSql="select * from crm_stu_wechat where open_id='"+fromUserName+"'"; if(conn==null){ return "连接数据库失败"; }else{ try { ps=conn.prepareStatement(selectSql); rs=ps.executeQuery(); if(rs.next()){ return "用户名已绑定"; }else{ return "请输入\"用户名绑定\"+登录用户名 如:用户名绑定fangw"; } } catch (SQLException e) { return "查询数据库失败"; }finally{ closeConnection(conn,ps,rs); } } } public List getAllUser(){ Connection conn=null; List list=new ArrayList(); PreparedStatement ps=null; ResultSet rs=null; conn=new DBCPConnection().getConnection(); String selectSql="select * from qx_users "; if(conn==null){ return null; }else{ try { ps=conn.prepareStatement(selectSql); rs=ps.executeQuery(); while(rs.next()){ list.add(rs.getString("USERNAME")); } } catch (SQLException e) { return null; }finally{ closeConnection(conn,ps,rs); } } return list; } /** * 绑定账号 * @param fromUserName * @param userName * @return */ public String bindAccount(String fromUserName,String userName){ Connection conn=null; PreparedStatement ps=null; ResultSet rs=null; String result=getBindStatus(fromUserName); if("连接数据库失败".equals(result)||("查询数据库失败".equals(result))){ return "连接数据库失败"; }else if("用户名已绑定".equals(result)){ return "用户名已绑定,无需重复绑定"; } conn = new DBCPConnection().getConnection(); List list=getAllUser(); if(!list.contains(userName)){ return "用户名不存在,绑定失败"; } int i = 0; String sql = "insert into crm_stu_wechat (open_id,user_name) values(?,?)"; try { ps = conn.prepareStatement(sql); ps.setString(1, fromUserName); ps.setString(2, userName); i = ps.executeUpdate(); if(i>0){ return "用户名绑定成功"; }else{ return "用户名绑定失败"; } } catch (SQLException e) { return "用户名绑定失败,未知错误"; }finally{ closeConnection(conn,ps,rs); } } /** * 解除账号绑定 * @param fromUserName * @param userName * @return */ public String unBindAccount(String userName){ Connection conn=null; PreparedStatement ps=null; ResultSet rs=null; conn = new DBCPConnection().getConnection(); int i = 0; String sql=" delete from crm_stu_wechat where user_name= ?"; try { ps = conn.prepareStatement(sql); ps.setString(1, userName); i = ps.executeUpdate(); if(i>0){ return "用户名解除绑定成功"; }else{ return "该用户名不存在"; } } catch (SQLException e) { return "用户名解除绑定失败,未知错误"; }finally{ closeConnection(conn,ps,rs); } } /** * 行程添加 * @param fromUserName * @return */ public String addTravel(String fromUserName){ Connection conn=null; PreparedStatement ps=null; ResultSet rs=null; String sbStr=""; conn = new DBCPConnection().getConnection(); String selectSql="select * from crm_stu_wechat where open_id='"+fromUserName+"'"; if(conn==null){ return "连接数据库失败"; }else{ try { ps=conn.prepareStatement(selectSql); rs=ps.executeQuery(); if(rs.next()){ String userName=rs.getString("user_name"); String selectTravelSql="select * from crm_student where user_id='"+userName+"'"; Connection connTravel= new DBCPConnection().getConnection(); PreparedStatement psTravel=connTravel.prepareStatement(selectTravelSql); ResultSet rsTravel=psTravel.executeQuery(); if(rsTravel.next()){ String name=rsTravel.getString("id"); sbStr="点击添加行程"; return sbStr; }else{ return "您未注册,请在电脑端完成注册"; } }else{ return "用户名未绑定,请输入\"用户名绑定\"+登录用户名 如:用户名绑定fangw"; } } catch (SQLException e) { return "查询数据库失败"; }finally{ closeConnection(conn,ps,rs); } } } /** * 行程查看 * @param fromUserName * @return */ public String viewTravel(String fromUserName){ Connection conn=null; PreparedStatement ps=null; ResultSet rs=null; StringBuffer sb=new StringBuffer(); conn = new DBCPConnection().getConnection(); String selectSql="select * from crm_stu_wechat where open_id='"+fromUserName+"'"; if(conn==null){ return "连接数据库失败"; }else{ try { ps=conn.prepareStatement(selectSql); rs=ps.executeQuery(); if(rs.next()){ String userName=rs.getString("user_name"); String selectTravelSql="select * from crm_student_info where user_id='"+userName+"'"; Connection connTravel= new DBCPConnection().getConnection(); PreparedStatement psTravel=connTravel.prepareStatement(selectTravelSql); ResultSet rsTravel=psTravel.executeQuery(); while(rsTravel.next()){ sb.append("考试时间:").append(rsTravel.getString("exam_time")).append("\n"); sb.append("考试院校:").append(rsTravel.getString("exam_school")).append("\n"); sb.append("考试地点:").append(rsTravel.getString("exam_area")).append("\n"); sb.append("居住城市:").append(rsTravel.getString("live_city")).append("\n"); sb.append("\n"); sb.append("---------------------------------"); sb.append("\n"); } if((sb.toString()==null||("".equals(sb.toString())))){ return "暂无您的行程"; }else{ return sb.toString(); } }else{ return "用户名未绑定,请输入\"用户名绑定\"+登录用户名 如:用户名绑定fangw"; } } catch (SQLException e) { return "查询数据库失败"; }finally{ closeConnection(conn,ps,rs); } } } /** * 查看个人信息 * @return */ public String viewStuInfo(String fromUserName){ Connection conn=null; PreparedStatement ps=null; ResultSet rs=null; StringBuffer sb=new StringBuffer(); conn = new DBCPConnection().getConnection(); String selectSql="select * from crm_stu_wechat where open_id='"+fromUserName+"'"; if(conn==null){ return "连接数据库失败"; }else{ try { ps=conn.prepareStatement(selectSql); rs=ps.executeQuery(); if(rs.next()){ String userName=rs.getString("user_name"); String selectStuSql="select * from crm_student where user_id='"+userName+"'"; Connection connStu= new DBCPConnection().getConnection(); PreparedStatement psStu=connStu.prepareStatement(selectStuSql); ResultSet rsStu=psStu.executeQuery(); if(rsStu.next()){ sb.append("用户名:").append(rsStu.getString("user_id")).append("\t").append("\n"); sb.append("姓名:").append(rsStu.getString("stu_name")).append("\t").append("\n"); if("0".equals(rsStu.getString("stu_sex"))){ sb.append("性别:").append("男").append("\t").append("\n"); }else{ sb.append("性别:").append("女").append("\t").append(

资源文件列表:

eastnet_wechat.zip 大约有126个文件
  1. eastnet_wechat/
  2. eastnet_wechat/.classpath 878B
  3. eastnet_wechat/.myeclipse/
  4. eastnet_wechat/.mymetadata 311B
  5. eastnet_wechat/.project 1.59KB
  6. eastnet_wechat/.settings/
  7. eastnet_wechat/.settings/.jsdtscope 500B
  8. eastnet_wechat/.settings/org.eclipse.core.resources.prefs 88B
  9. eastnet_wechat/.settings/org.eclipse.jdt.core.prefs 364B
  10. eastnet_wechat/.settings/org.eclipse.wst.common.component 476B
  11. eastnet_wechat/.settings/org.eclipse.wst.common.project.facet.core.xml 252B
  12. eastnet_wechat/.settings/org.eclipse.wst.jsdt.ui.superType.container 49B
  13. eastnet_wechat/.settings/org.eclipse.wst.jsdt.ui.superType.name 6B
  14. eastnet_wechat/src/
  15. eastnet_wechat/src/com/
  16. eastnet_wechat/src/com/eastnet/
  17. eastnet_wechat/src/com/eastnet/wechat/
  18. eastnet_wechat/src/com/eastnet/wechat/main/
  19. eastnet_wechat/src/com/eastnet/wechat/main/MenuManager.java 4.35KB
  20. eastnet_wechat/src/com/eastnet/wechat/message/
  21. eastnet_wechat/src/com/eastnet/wechat/message/req/
  22. eastnet_wechat/src/com/eastnet/wechat/message/req/BaseMessage.java 1.48KB
  23. eastnet_wechat/src/com/eastnet/wechat/message/req/ImageMessage.java 311B
  24. eastnet_wechat/src/com/eastnet/wechat/message/req/LinkMessage.java 644B
  25. eastnet_wechat/src/com/eastnet/wechat/message/req/LocationMessage.java 869B
  26. eastnet_wechat/src/com/eastnet/wechat/message/req/TextMessage.java 338B
  27. eastnet_wechat/src/com/eastnet/wechat/message/req/VoiceMessage.java 485B
  28. eastnet_wechat/src/com/eastnet/wechat/message/resp/
  29. eastnet_wechat/src/com/eastnet/wechat/message/resp/Article.java 1.03KB
  30. eastnet_wechat/src/com/eastnet/wechat/message/resp/BaseMessage.java 1.12KB
  31. eastnet_wechat/src/com/eastnet/wechat/message/resp/Music.java 946B
  32. eastnet_wechat/src/com/eastnet/wechat/message/resp/MusicMessage.java 321B
  33. eastnet_wechat/src/com/eastnet/wechat/message/resp/NewsMessage.java 650B
  34. eastnet_wechat/src/com/eastnet/wechat/message/resp/TextMessage.java 348B
  35. eastnet_wechat/src/com/eastnet/wechat/pojo/
  36. eastnet_wechat/src/com/eastnet/wechat/pojo/AccessToken.java 534B
  37. eastnet_wechat/src/com/eastnet/wechat/pojo/Button.java 242B
  38. eastnet_wechat/src/com/eastnet/wechat/pojo/CommonButton.java 437B
  39. eastnet_wechat/src/com/eastnet/wechat/pojo/ComplexButton.java 318B
  40. eastnet_wechat/src/com/eastnet/wechat/pojo/Menu.java 260B
  41. eastnet_wechat/src/com/eastnet/wechat/pojo/ViewButton.java 347B
  42. eastnet_wechat/src/com/eastnet/wechat/service/
  43. eastnet_wechat/src/com/eastnet/wechat/service/EastnetService.java 8.78KB
  44. eastnet_wechat/src/com/eastnet/wechat/servlet/
  45. eastnet_wechat/src/com/eastnet/wechat/servlet/CreateMenuServlet.java 5.63KB
  46. eastnet_wechat/src/com/eastnet/wechat/servlet/EastnetServlet.java 2.26KB
  47. eastnet_wechat/src/com/eastnet/wechat/test/
  48. eastnet_wechat/src/com/eastnet/wechat/test/Test.java 1.76KB
  49. eastnet_wechat/src/com/eastnet/wechat/utils/
  50. eastnet_wechat/src/com/eastnet/wechat/utils/DBCPConnection.java 1.11KB
  51. eastnet_wechat/src/com/eastnet/wechat/utils/MessageUtil.java 4.61KB
  52. eastnet_wechat/src/com/eastnet/wechat/utils/MyX509TrustManager.java 688B
  53. eastnet_wechat/src/com/eastnet/wechat/utils/OpenDBConnection.java 2.16KB
  54. eastnet_wechat/src/com/eastnet/wechat/utils/OperatorUtil.java 12.57KB
  55. eastnet_wechat/src/com/eastnet/wechat/utils/SignUtil.java 2.53KB
  56. eastnet_wechat/src/com/eastnet/wechat/utils/WeixinUtil.java 6.09KB
  57. eastnet_wechat/src/com/eastnet/wechat/weChat 191B
  58. eastnet_wechat/src/dbcp.properties 595B
  59. eastnet_wechat/WebRoot/
  60. eastnet_wechat/WebRoot/index.jsp 922B
  61. eastnet_wechat/WebRoot/META-INF/
  62. eastnet_wechat/WebRoot/META-INF/MANIFEST.MF 36B
  63. eastnet_wechat/WebRoot/success.jsp 840B
  64. eastnet_wechat/WebRoot/WEB-INF/
  65. eastnet_wechat/WebRoot/WEB-INF/classes/
  66. eastnet_wechat/WebRoot/WEB-INF/classes/com/
  67. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/
  68. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/
  69. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/main/
  70. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/main/MenuManager.class 3.22KB
  71. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/message/
  72. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/message/req/
  73. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/message/req/BaseMessage.class 1.65KB
  74. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/message/req/ImageMessage.class 614B
  75. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/message/req/LinkMessage.class 1009B
  76. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/message/req/LocationMessage.class 1.21KB
  77. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/message/req/TextMessage.class 605B
  78. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/message/req/VoiceMessage.class 815B
  79. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/message/resp/
  80. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/message/resp/Article.class 1.14KB
  81. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/message/resp/BaseMessage.class 1.44KB
  82. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/message/resp/Music.class 1.17KB
  83. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/message/resp/MusicMessage.class 676B
  84. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/message/resp/NewsMessage.class 1.09KB
  85. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/message/resp/TextMessage.class 618B
  86. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/pojo/
  87. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/pojo/AccessToken.class 773B
  88. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/pojo/Button.class 541B
  89. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/pojo/CommonButton.class 752B
  90. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/pojo/ComplexButton.class 639B
  91. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/pojo/Menu.class 586B
  92. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/pojo/ViewButton.class 746B
  93. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/service/
  94. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/service/EastnetService.class 4.51KB
  95. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/servlet/
  96. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/servlet/CreateMenuServlet.class 3.68KB
  97. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/servlet/EastnetServlet.class 2.01KB
  98. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/test/
  99. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/test/Test.class 2.21KB
  100. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/utils/
  101. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/utils/DBCPConnection.class 1.19KB
  102. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/utils/MessageUtil$1$1.class 1.37KB
  103. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/utils/MessageUtil$1.class 759B
  104. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/utils/MessageUtil.class 3.85KB
  105. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/utils/MyX509TrustManager.class 903B
  106. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/utils/OpenDBConnection.class 2.42KB
  107. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/utils/OperatorUtil.class 9.32KB
  108. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/utils/SignUtil.class 3.13KB
  109. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/utils/WeixinUtil.class 5.12KB
  110. eastnet_wechat/WebRoot/WEB-INF/classes/com/eastnet/wechat/weChat 191B
  111. eastnet_wechat/WebRoot/WEB-INF/classes/dbcp.properties 1.31KB
  112. eastnet_wechat/WebRoot/WEB-INF/lib/
  113. eastnet_wechat/WebRoot/WEB-INF/lib/com.springsource.org.apache.commons.logging-1.1.1.jar 60.02KB
  114. eastnet_wechat/WebRoot/WEB-INF/lib/com.springsource.org.apache.commons.pool-1.5.3.jar 94.85KB
  115. eastnet_wechat/WebRoot/WEB-INF/lib/commons-beanutils-1.7.0.jar 184.25KB
  116. eastnet_wechat/WebRoot/WEB-INF/lib/commons-collections-3.1.jar 546.26KB
  117. eastnet_wechat/WebRoot/WEB-INF/lib/commons-dbcp-1.4.jar 156.76KB
  118. eastnet_wechat/WebRoot/WEB-INF/lib/commons-lang-2.3.jar 239.53KB
  119. eastnet_wechat/WebRoot/WEB-INF/lib/dom4j-1.6.1.jar 306.54KB
  120. eastnet_wechat/WebRoot/WEB-INF/lib/ezmorph-1.0.3.jar 76KB
  121. eastnet_wechat/WebRoot/WEB-INF/lib/json-lib-2.4-jdk15.jar 155.39KB
  122. eastnet_wechat/WebRoot/WEB-INF/lib/mysql-connector-java-5.1.7-bin.jar 693.28KB
  123. eastnet_wechat/WebRoot/WEB-INF/lib/slf4j-log4j12-1.7.7.jar 8.66KB
  124. eastnet_wechat/WebRoot/WEB-INF/lib/xmlpull_1_0_5.jar 5.93KB
  125. eastnet_wechat/WebRoot/WEB-INF/lib/xstream-1.4.jar 481.17KB
  126. eastnet_wechat/WebRoot/WEB-INF/web.xml 1.28KB
0评论
提交 加载更多评论
其他资源 Visual.Assist.X.V10.8.2001原版安装文件及破解补丁Patch
vc助手 Visual assist的2013.09.20发行的最新2001版本的补丁和原版的安装文件。下载的压缩包内提供了原版的安装文件和破解补丁,为了方便各位使用,具体更新列表以及补丁的使用方法参见我的博客(特别是无法破解的朋友,还有不知道如何破解VC2012的朋友,如果发现有破解不了的情况,一定是你们自己的操作哪里除了问题),因为所有的补丁都是本人在win7/win8以及VC2010和VC2012中亲测可用的。 http://blog.csdn.net/PiggyXP
ILSpy 安装包和压缩包
这是一份包含ILSpy 7.1的【ILSpy.AddIn.vsix(用户安装在Visual Studio 2019扩展工具)】和独立的【ILSpy_binaries_7.1.0.6543.zip】压缩包
读取xls和xlsxjar包
从java读取xls和xlsx所必须使用的jar包
C#自己绘制的QQ好友列表控件
详细介绍 看些的博客 http://blog.csdn.net/crystal_lz/article/details/8170491 顺便希望有人能解决一下博客中提到的TypeConverter的问题!、、
AndroidTTSDemoSixth--NiHaoTTS
http://blog.csdn.net/ichliebephone/archive/2011/04/30/6373184.aspx对应的代码例子
C#高质量仿腾讯截图程序(改_1)
效果图和说明 看博客 http://blog.csdn.net/crystal_lz/article/details/9200859
最简单的基于FFmpeg的编码器 1.2
本程序实现了YUV像素数据编码为视频码流(H.265,H264,MPEG2,VP8等等)。是最简单的FFmpeg视频编码方面的教程。它包含以下两个子项目: simplest_ffmpeg_video_encoder:最简单的基于FFmpeg的视频编码器。使用libavcodec和libavformat编码并且封装视频。 simplest_ffmpeg_video_encoder_pure:最简单的基于FFmpeg的视频编码器-纯净版。仅使用libavcodec编码视频,不使用libavformat。 1.2版本增加了多平台下编译的支持:Windows,MacOS,以及Linux。
C#高质量仿腾讯截图程序(改)
效果截图于介绍 在博客中有 http://blog.csdn.net/crystal_lz/article/details/8274277 在上一个上传的资源上改的 修正了已知bug增加快捷键启动 以及是否加入开机自启