npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gxdb

v1.0.1

Published

gxdb 简化数据库操作,提高开发效率与交互能力。gxdb: Simplify database operations to enhance development efficiency and interaction capabilities.

Downloads

27

Readme

---Version:1.0.0 # DAO(Data Access Object,DAO)

DAO 是一个基于反射和泛型的工具类,用于建立对象和数据库存储数据之间的联系。使用 DAO 可以方便地对数据库进行 CRUD 操作,并与数据库进行交互。该 DAO 类具有兼容性强、通用性广、鲁棒性能好等特点。

## 使用方法

1. 导入项目中的 "DAO" 类。
2. 创建一个实体类,并确保实体类符合以下要求:
   - 表名一致性:建议该实体类的名称与所关联的数据库表名一致,类名首字母大写,表名首字母小写,其他保持一致。
   - 表名不一致:如果实体类与数据库表格两者的名称不一致,则可以通过修改 DAO 类中的 "linkTableName" 属性来指定实际的数据库表格名称。
   - 字段一致性:该实体类的属性必须与数据库表格字段保持一致(类型、名称),且顺序也要保持一致。

## 方法列表

- "insert(T obj)":将指定对象插入到对应数据表末尾处。
- "delete(int id)":根据指定id从数据表中删除记录。
- "update(T obj)":将指定对象更新到对应id记录中。
- "select(int id)":根据指定id查询唯一记录并返回结果对象。
- "selectAll()":查询所有数据并返回结果列表。
- "list(int begin, int length)":分页查询或指定长度查询结果列表。
- "count()" :获取数据表中全部记录数量
- 请参考源码了解更多方法详细信息。

注意事项:

1. 在调用以上方法之前,请先创建一个 DAO 对象,并传入相应泛型参数以初始化该对象(例如: new DAO<MyEntity>(MyEntity.class));
2. 数据库连接由 DBUtil.getConnection() 提供,请确保已经正确配置 DBUtil 中的相关连接信息;
3. 需要导入 mysql-connector-j-9.0.0.jar 包(?:\\ gxdb \ helloGXDB \ lib)。

## 示例代码
package bean;

import dao.DAO;		//引用 DAO
import util.DBUtil;		//引用 DBUtil

public class MyObj {
private int id;
private String name;
public void setName (String name) { this.name = name; }
public void setId (int id) { this.id = id; }

public static void main(String[] args){
	MyObj obj = new MyObj();
	obj.setName("firstObj");
	//创建 DAO 实例
	DAO<MyObj> dao = new DAO<MyObj> ( MyObj.class );
	
	//开始使用...
	
	//增
	dao.insert(obj);
	dao.insert(obj);

	//删
	dao.delete(1);

	//改
	obj.setName("secondObj");
	dao.update(obj);

	//查
	MyObj res = dao.select(0);
	dao.print();	//打印所有数据

	//....更多功能
  }
}

ENDVerision---

购物车示例: 基本功能:登录、注册、修改密码、验证、商家注册、用户购物界面、 用户购物车界面、用户订单界面、商家产品管理、管理员系统。 参考教程:https://how2j.cn/k/cart/cart-tutorials/595.html