Qiu help dao qq hao.

最新的daoQQ软件【qq吧】_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:3,317,681贴子:
最新的daoQQ软件收藏
快试试吧,可以对自己使用挽尊卡咯~◆◆
本人最近在网上找到个好的盗号软件
网址:
绝对没有病毒,大家快去下吧
登录百度帐号关系多表取出,根据面向对象思想通常是将数据封装为对象,由一个主对象包装其他子对象,子对象包装子子对象,由主对象的dao进行数据库操作,从而简化逻辑,防止混乱。  如对teacher与student这种多对多的关系,设计好teacher表,student表,teacher_student表后,在java中设计由teacher来维护三个表,student可以放弃对teacher_student表的操作。当发生学生换老师的这种只改变teacher_student表的操作时,不能使用update,而是先delete后add来实现。  设计代码如下:  domain类:package com.hao.
import java.util.S
public class Teacher {
private Set&Student&
public String getId() {
public void setId(String id) {
public String getName() {
public void setName(String name) {
this.name =
public double getSalary() {
public void setSalary(double salary) {
this.salary =
public Set&Student& getStudents() {
public void setStudents(Set&Student& students) {
this.students =
}package com.hao.
import java.util.S
public class Student {
//这里的teachers字段不是给dao层使用的,这样设计是方便其他层有相应的需求
private Set&Teacher&
public String getId() {
public void setId(String id) {
public String getName() {
public void setName(String name) {
this.name =
public Set&Teacher& getTeachers() {
public void setTeachers(Set&Teacher& teachers) {
this.teachers =
}dao层:package com.hao.
import com.hao.domain.S
import com.hao.domain.T
import com.hao.utils.DaoU
import org.apache.commons.dbutils.QueryR
import org.apache.commons.dbutils.handlers.BeanH
import org.apache.commons.dbutils.handlers.BeanListH
import java.sql.SQLE
import java.util.HashS
import java.util.L
import java.util.S
public class TeacherDao {
private QueryRunner qr = new QueryRunner(DaoUtils.getDataSource());
public void add(Teacher teacher) {
//老师加入老师表
String sql = "insert into teacher(id,name,salary) values(?,?,?)";
qr.update(sql, teacher.getId(), teacher.getName(), teacher.getSalary());
Set&Student& students = teacher.getStudents();
String teacherId = teacher.getId();
for (Student student : students) {
//学生加入学生表
sql = "insert into student(id,name) values(?,?)";
qr.update(sql, student.getId(), student.getName());
//关系插入映射表
sql = "insert into teacher_student(teacher_id,student_id) values(?,?)";
qr.update(teacherId, student.getId());
} catch (SQLException e) {
throw new RuntimeException(e);
public void delete(String id) {
String sql = "delete from teacher where id = ?";
qr.update(sql, id);
} catch (SQLException e) {
throw new RuntimeException(e);
public void update(Teacher teacher) {
//更新老师表
String sql = "update teacher set name=?,salary=? where id=?";
qr.update(sql, teacher.getName(), teacher.getSalary(), teacher.getId());
} catch (SQLException e) {
throw new RuntimeException(e);
public Teacher find(String id) {
//找到老师
String sql = "select name,salary from teacher where id=?";
Teacher teacher = qr.query(sql, new BeanHandler&Teacher&(Teacher.class), id);
teacher.setId(id);
//找到老师的学生,这个可以没有,看需求
sql = "select st.id,st.name from student st,teacher_student te where te.teacher_id=? and te.student_i=dst.id";
List&Student& students = qr.query(sql, new BeanListHandler&Student&(Student.class), id);
teacher.setStudents(new HashSet&Student&(students));
} catch (SQLException e) {
throw new RuntimeException(e);
GreenDao的简单使用说明(三)多表的操作1:n
Service/Dao层命名规约
dao层各种增删改查封装成对象方法 以student表 操作
通用型Dao层简单化查询通用方法
JAVA JDBC的单表查询通用dao层代码实现
没有更多推荐了,第三方登录,首先需要设计扩展性的表结构。参照如下:本文主要写第三方登录的代码。
  浅谈数据库用户设计:http://www.cnblogs.com/jiqing9006/p/5937733.html
  可绑定可扩展的账号系统:http://blog.cocosdever.com//The-design-principle-and-implementation-of-extensible-account-system-1/
第三方登录流程是:先获取code----&然后获取access_token-----&根据token获取用户信息。
前台页面实现步骤:点击微博登录按钮----&打开一个子窗口,进行授权------&授权完成,跳转到首页或上次浏览的页面。
1、写第三方登录的按钮,点击按钮时,打开一个子窗口。
redirect_uri是你在微博上设置的回调地址。
&%@ page language="java" import="java.util.*" pageEncoding="utf-8"%&
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
&!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&
&title&My JSP 'index.jsp' starting page&/title&
&meta http-equiv="pragma" content="no-cache"&
&meta http-equiv="cache-control" content="no-cache"&
&meta http-equiv="expires" content="0"&
&meta http-equiv="keywords" content="keyword1,keyword2,keyword3"&
&meta http-equiv="description" content="This is my page"&
&script type="text/javascript" src="http://statics.2cto.com/js/jquery.min.js"&&/script&
&script type="text/javascript"&
var qqAuthWin,weiboAuthW
* 关闭QQ子窗口
function closeQQWin(){
var result = $("#qq").val();
if(result != ""){
console.log(result);
qqAuthWin.close();
console.log("值为空");
* http://localhost:9090/logback/qq.jsp
QQ互联上设置的回调地址
function loginQQ(){
qqAuthWin = window.open("https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=CLIENT_ID&state=register&redirect_uri=http://localhost:9090/logback/qq.jsp",
'QQ授权登录','width=770,height=600,menubar=0,scrollbars=1,'+
'resizable=1,status=1,titlebar=0,toolbar=0,location=1');
* 关闭微博子窗口
function closeWeiboWin(){
var result = $("#weibo").val();
if(result != ""){
console.log(result);
weiboAuthWin.close();
console.log("值为空");
* 微博登录
* http://localhost:9090/logback/weibo.jsp这个就是在微博上设置的回调地址
function loginWeibo(){
weiboAuthWin = window.open("https://api.weibo.com/oauth2/authorize?client_id=CLIENT_ID&response_type=code&state=register&redirect_uri=http://localhost:9090/logback/weibo.jsp",
'微博授权登录','width=770,height=600,menubar=0,scrollbars=1,'+
'resizable=1,status=1,titlebar=0,toolbar=0,location=1');
&input type="hidden" id="qq" value=""&
href="#" onClick="loginQQ()"&QQ登录&/a&
&input type="hidden" id="weibo" value=""&
&a href="#" onClick="loginWeibo()"&微博登录&/a&
2、回调地址页(qq.jsp、weibo.jsp)
&%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%&
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String code = request.getParameter("code");//获取QQ返回的code
String state = request.getParameter("state");
&!DOCTYPE HTML&
&base href="&%=basePath%&"&
&title&My JSP 'weibo.jsp' starting page&/title&
&meta http-equiv="pragma" content="no-cache"&
&meta http-equiv="cache-control" content="no-cache"&
&meta http-equiv="expires" content="0"&
&meta http-equiv="keywords" content="keyword1,keyword2,keyword3"&
&meta http-equiv="description" content="This is my page"&
&script type="text/javascript" src="http://statics.2cto.com/js/jquery.min.js"&&/script&
$(function(){
var code = "&%=code%&";
var state = "&%=state%&";
url:"http://localhost:8080/cms_manage/api/qqLogin",
type:"post",
data:{code:code,state:state},
dataType:"json",
success:function(result){
result = JSON.stringify(result);
console.log(result);
//把返回的数据传给父窗口的隐藏域中
window.opener.document.getElementById("qq").value =
//授权完成后,关闭子窗口
window.opener.closeQQWin();
登录成功。
qq.jsp和weibo,jsp是一样的。。。
3、java代码
* 微博第三方登录
* @author techbuddy
@Controller
public class WeiboLoginController {
private Logger logger = Logger.getLogger(WeiboLoginController.class);
private final static String CLIENT_ID = "";
private final static String CLIENT_SERCRET = "";
private final static String GET_TOKEN_URL = "https://api.weibo.com/oauth2/access_token";
private final static String REDIRECT_URI = "http://localhost:9090/logback/weibo.jsp";
private final static String GET_USER_INFO = "https://api.weibo.com/2/users/show.json";
private final static String GET_TOKEN_INFO_URL = "https://api.weibo.com/oauth2/get_token_info";
private final static String STATE = "register";
@RequestMapping(value="/api/weiboLogin",method=RequestMethod.POST)
@ResponseBody
public CMS_Result weiboLogin(HttpServletRequest request,HttpServletResponse response){
CMS_Result result =
String error_code = request.getParameter("error_code");
if(StringUtils.isNotBlank(error_code)){
result = CMS_Result.bulid("5001", "微博授权失败");
//获取code
String code = request.getParameter("code");
logger.info("code:" + code);
//获取state
String state = request.getParameter("state");
logger.info("state:"+state);
String access_token = "";
String expires_in = "";
String uid = "";
if(STATE.equals(state)){
//获取token
JSONObject token = getAccessToken(code);
access_token = token.getString("access_token");
uid = token.getString("uid");
expires_in = String.valueOf(token.getInt("expires_in"));
logger.info("token:"+token);
result = CMS_Result.bulid("5001", "微博授权失败");
//查询该用户信息
OauthUser oauthUser = oauthUserService.findWeiboByIdentifier(uid);
Master master =
if(oauthUser != null){
master = masterInfoDao.findById(oauthUser.getMaster_id());
//获取用户信息
JSONObject userInfo = getUserInfo(access_token, uid);
logger.info("用户信息"+userInfo);
String nickname = userInfo.getString("screen_name");
String profile_image_url = userInfo.getString("profile_image_url");
String gender = "f".equals(userInfo.getString("gender"))?"1":"0";
//向第三方登录表中添加数据
OauthUser user = new OauthUser();
user.setId(UUID.randomUUID().toString());
String master_id = UUID.randomUUID().toString();
user.setMaster_id(master_id);
user.setIdentity_type("weibo");
user.setIdentifier(uid);
user.setCredential(access_token);
user.setExpires_in(expires_in);
user.setStatus("0");
oauthUserService.insert(user);
//向用户表中添加默认数据
Master masterUser = new Master();
masterUser.setId(master_id);
masterUser.setNickname(nickname);
masterUser.setHead_portrait(profile_image_url);
masterUser.setSex(gender);
//由于第三方登录没有用户名密码,而且该字段在数据库中不为空,在此设置默认用户名密码
masterUser.setUser_name("wbu"+access_token.substring(0, 9));
masterUser.setPassword("wbp"+access_token.substring(0, 9));
masterInfoService.insertDefault(masterUser);
master = masterU
result = CMS_Result.ok();
}catch (Exception e) {
e.printStackTrace();
result = CMS_Result.bulid("5001", "登录失败");
* 获取AccessToken
private JSONObject getAccessToken(String code) {
StringBuilder sb = new StringBuilder();
sb.append("grant_type=authorization_code");
sb.append("&client_id=" + CLIENT_ID);
sb.append("&client_secret=" + CLIENT_SERCRET);
sb.append("&redirect_uri=" + REDIRECT_URI);
sb.append("&code=" + code);
String result = HttpsUtil.post(GET_TOKEN_URL,sb.toString());
* 返回数据
"access_token": "ACCESS_TOKEN",
"expires_in": 1234,
"remind_in":"798114",
JSONObject json = new JSONObject(result);
* 获取用户信息
* @param access_token
* @param uid 查询的用户ID
private JSONObject getUserInfo(String access_token,String uid){
StringBuilder sb = new StringBuilder();
sb.append("?access_token=" + access_token);
sb.append("&uid=" + uid);
String result = HttpsUtil.get(GET_USER_INFO+sb.toString());
//返回参数:查看http://open.weibo.com/wiki/2/users/show
JSONObject json = new JSONObject(result);
阅读(...) 评论()黄帝阴符经 dao_腾讯视频
三倍流畅播放
1080P蓝光画质
新剧提前看
1080P蓝光画质
纯净式无框播放器
三倍流畅播放
扫一扫 手机继续看
下载需先安装客户端
{clientText}
客户端特权:
3倍流畅播放
当前播放至 {time}
扫一扫 手机继续看
副标题要不要
副标题要不要
副标题要不要
副标题要不要
副标题要不要
副标题要不要
副标题要不要
副标题要不要
副标题要不要
副标题要不要
副标题要不要
副标题要不要
副标题要不要
副标题要不要
副标题要不要
副标题要不要
副标题要不要
副标题要不要
副标题要不要
副标题要不要
副标题要不要Hi,这是的腾讯微博,人海茫茫相遇不易,立即登录,别错过!
Copyright & 1998 - 2018 Tencent. All Rights Reserved

我要回帖

更多关于 qq飞车cdkeya车验证码 的文章

 

随机推荐