1.求Java web增删改查 极简源码
2.求一个能实现屏幕水波纹效果的vb代码
求Java web增删改查 极简源码
//用户新增
public boolean addUser(Users user){
try {
conn = ConnDB.getConnection();
String sql = "insert into tb_users values(default,?,?,?,?,?,?)";
System.out.println(sql);
ps = conn.prepareStatement(sql);
ps.setInt(1, user.getDepID());
ps.setString(2, user.getUserName());
ps.setString(3, user.getUserPwd());
ps.setString(4, user.getUserCode());
ps.setString(5, user.getUserSex());
ps.setInt(6, user.getUserAge());
if(ps.executeUpdate()==1){
return true;
}
} catch (Exception e) {
e.printStackTrace();
} finally{ //关闭当前页打开的相关对象
ConnDB.close(conn, ps, null);
}
return false;
}
//用户删除
public boolean delUser(int id){
try {
conn = ConnDB.getConnection();
String sql = "delete from tb_users where id = ?";
System.out.println(sql);
ps = conn.prepareStatement(sql);
ps.setInt(1, id);
if(ps.executeUpdate()==1){
return true;
}
} catch (Exception e) {
e.printStackTrace();
} finally{ //关闭当前页打开的相关对象
ConnDB.close(conn, ps, null);
}
return false;
}
//用户编辑
public boolean updateUser(Users user){
try {
conn = ConnDB.getConnection();
String sql = "update tb_users set depID=?,userName=?,userPwd=?,userCode=?,userSex=?,userAge=? where id=?";
System.out.println(user.getDepID()+ user.getUserName()+user.getUserPwd()+user.getUserCode()+user.getUserSex()+user.getUserAge()+user.getId());
ps = conn.prepareStatement(sql);
ps.setInt(1, user.getDepID());
ps.setString(2, user.getUserName());
ps.setString(3, user.getUserPwd());
ps.setString(4, user.getUserCode());
ps.setString(5, user.getUserSex());
ps.setInt(6, user.getUserAge());
ps.setInt(7, user.getId());
if(ps.executeUpdate()==1){
return true;
}
} catch (Exception e) {
e.printStackTrace();
} finally{ //关闭当前页打开的相关对象
ConnDB.close(conn, ps, null);
}
return false;
}
//根据id查询用户
public Users findAllUserById(int id){
Users u = null;
DepDao depd = null;
try {
conn = ConnDB.getConnection();
String sql = "select * from tb_users where id=?";
System.out.println(sql);
ps = conn.prepareStatement(sql);
ps.setInt(1, id);
rs = ps.executeQuery();
if(rs.next()){
depd = new DepDao();
Department dep = depd.findAllDepById(rs.getInt("depID"));
System.out.println(dep.getDepName());
u = new Users();
u.setId(rs.getInt("id"));
u.setDepID(rs.getInt("depID"));
u.setUserName(rs.getString("userName"));
u.setUserPwd(rs.getString("userPwd"));
u.setUserCode(rs.getString("userCode"));
u.setUserSex(rs.getString("userSex"));
u.setUserAge(rs.getInt("userAge"));
u.setDep(dep);
}
} catch (Exception e) {
e.printStackTrace();
} finally{ //关闭当前页打开的相关对象
ConnDB.close(conn, ps, rs);
}
return u;
}
这是我在dao层写的代码,都调用了ConnDB这个类,如何调试gcc源码这个类完成了驱动的网络棋牌源码出售注册,及连接数据库的云黑插件源码功能,代码如下:
package com.asjy.util;import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class ConnDB {
private static String url = "jdbc:mysql://localhost:/news";
private static String user = "root";
private static String pass = "root";
//1.加载驱动
static{
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e) {
System.out.println("驱动加载失败");
}
}
//2.建立数据库连接对象
public static Connection getConnection() throws Exception{
return DriverManager.getConnection(url,minecraft源码怎么编译user,pass);
}
//3.关闭数据库
public static void close(Connection conn,Statement ps,ResultSet rs){
try {
if(rs!=null){
rs.close();
rs = null;
}
if(ps!=null){
ps.close();
ps = null;
}
if(conn!=null){
conn.close();
conn = null;
}
} catch (SQLException e) {
e.printStackTrace();
}
}
}
求一个能实现屏幕水波纹效果的vb代码
'补模块3文件。一个放不下。CPU悬浮窗源码
'>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
' 渲染子程序,将新的帧数据渲染到 lpDIBitsRender 中
' 算法:
' posx = Wave1(x-1,y)-Wave1(x+1,y)+x
' posy = Wave1(x,y-1)-Wave1(x,y+1)+y
' SourceBmp(x,y) = DestBmp(posx,posy)
'>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Public Sub WaveRender(lpWaveObject As WAVE_OBJECT)
Dim dwPosX As Long, dwPosY As Long, dwPtrSource As Long, dwPtrDest As Long, dwFlag As Long
Dim lpWave1 As Long, LineIdx As Long, LinePtr As Long
Dim lpDIBitsSource As Long, lpDIBitsRender As Long
Dim I As Long, J As Long
dwFlag = 0
With lpWaveObject
'Debug.Print "WaveRender " & .dwFlag
If (.dwFlag And F_WO_ACTIVE) = 0 Then Exit Sub
.dwFlag = .dwFlag Or F_WO_NEED_UPDATE
lpWave1 = .lpWave1
LineIdx = .dwWaveByteWidth '像素指针
For I = 1 To .dwBmpHeight - 2
For J = 0 To .dwBmpWidth - 1
'
2024-12-23 06:30295人浏览
2024-12-23 06:292131人浏览
2024-12-23 06:211265人浏览
2024-12-23 05:25982人浏览
2024-12-23 05:152124人浏览
2024-12-23 04:291217人浏览
台灣桌球男團今6))天和日本隊爭搶4強門票,第1點雙打由「師徒檔」莊智淵、高承睿出戰,以0比3敗陣;第2點由林昀儒對上張本智和,兩人激戰5局,由林昀儒3比2搶下1點;第3點男單高承睿上陣,0比3落敗,
1.?Ƿ?Դ????վ2.股价提醒源码是什么涨幅提醒3.我想从网页上比如网易、新浪)上实时抓取大盘和个股的实时行情,请给出VB的完整源码,并加注释。?Ƿ?Դ????վ 涨幅,上影,下影,振幅,实体
1.咸鱼 py是什么意思?2.小游戏出海!势在必行!内含出海工具推荐)3.武汉黑马是不是很黑,我朋友推荐我去一个叫源码时代时代的机构?4.咸鱼之王_手游_开服搭建架设_内购修复无bug运营版咸鱼 py