`
techno_it
  • 浏览: 54617 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

spring security例程搭建(Mysql)

 
阅读更多
    在Spring security2.0.4发布的包中,提供了,相应的例程,可是由于它缺省使用的并非Mysql数据库的问题,导致我们无法直接搭建起例程。如果要搭建起例程就需要修改SQL语句,使其适用于Mysql。现对,修改内容说明如下:
    一:SQL语句的修改,修改DataSourcePopulator.java文件。
        template.execute(
            "CREATE TABLE ACL_SID(" +
                    "ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 100) NOT NULL PRIMARY KEY," +
                    "PRINCIPAL BOOLEAN NOT NULL," +
                    "SID VARCHAR_IGNORECASE(100) NOT NULL," +
                    "CONSTRAINT UNIQUE_UK_1 UNIQUE(SID,PRINCIPAL));");
        template.execute(
            "CREATE TABLE ACL_CLASS(" +
                    "ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 100) NOT NULL PRIMARY KEY," +
                    "CLASS VARCHAR_IGNORECASE(100) NOT NULL," +
                    "CONSTRAINT UNIQUE_UK_2 UNIQUE(CLASS));");
        template.execute(
            "CREATE TABLE ACL_OBJECT_IDENTITY(" +
                    "ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 100) NOT NULL PRIMARY KEY," +
                    "OBJECT_ID_CLASS BIGINT NOT NULL," +
                    "OBJECT_ID_IDENTITY BIGINT NOT NULL," +
                    "PARENT_OBJECT BIGINT," +
                    "OWNER_SID BIGINT," +
                    "ENTRIES_INHERITING BOOLEAN NOT NULL," +
                    "CONSTRAINT UNIQUE_UK_3 UNIQUE(OBJECT_ID_CLASS,OBJECT_ID_IDENTITY)," +
                    "CONSTRAINT FOREIGN_FK_1 FOREIGN KEY(PARENT_OBJECT)REFERENCES ACL_OBJECT_IDENTITY(ID)," +
                    "CONSTRAINT FOREIGN_FK_2 FOREIGN KEY(OBJECT_ID_CLASS)REFERENCES ACL_CLASS(ID)," +
                    "CONSTRAINT FOREIGN_FK_3 FOREIGN KEY(OWNER_SID)REFERENCES ACL_SID(ID));");
        template.execute(
            "CREATE TABLE ACL_ENTRY(" +
                    "ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 100) NOT NULL PRIMARY KEY," +
                    "ACL_OBJECT_IDENTITY BIGINT NOT NULL,ACE_ORDER INT NOT NULL,SID BIGINT NOT NULL," +
                    "MASK INTEGER NOT NULL,GRANTING BOOLEAN NOT NULL,AUDIT_SUCCESS BOOLEAN NOT NULL," +
                    "AUDIT_FAILURE BOOLEAN NOT NULL,CONSTRAINT UNIQUE_UK_4 UNIQUE(ACL_OBJECT_IDENTITY,ACE_ORDER)," +
                    "CONSTRAINT FOREIGN_FK_4 FOREIGN KEY(ACL_OBJECT_IDENTITY) REFERENCES ACL_OBJECT_IDENTITY(ID)," +
                    "CONSTRAINT FOREIGN_FK_5 FOREIGN KEY(SID) REFERENCES ACL_SID(ID));");

        template.execute(
            "CREATE TABLE USERS(USERNAME VARCHAR_IGNORECASE(50) NOT NULL PRIMARY KEY,PASSWORD VARCHAR_IGNORECASE(50) NOT NULL,ENABLED BOOLEAN NOT NULL);");
        template.execute(
            "CREATE TABLE AUTHORITIES(USERNAME VARCHAR_IGNORECASE(50) NOT NULL,AUTHORITY VARCHAR_IGNORECASE(50) NOT NULL,CONSTRAINT FK_AUTHORITIES_USERS FOREIGN KEY(USERNAME) REFERENCES USERS(USERNAME));");
        template.execute("CREATE UNIQUE INDEX IX_AUTH_USERNAME ON AUTHORITIES(USERNAME,AUTHORITY);");

        template.execute(
            "CREATE TABLE CONTACTS(ID BIGINT NOT NULL PRIMARY KEY, CONTACT_NAME VARCHAR_IGNORECASE(50) NOT NULL, EMAIL VARCHAR_IGNORECASE(50) NOT NULL)");

上面代码需要修改如下内容:
引用

GENERATED BY DEFAULT AS IDENTITY(START WITH 100) NOT NULL PRIMARY KEY


改成:
引用

BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY


引用
VARCHAR_IGNORECASE

改成:
引用

VARCHAR


运行程序后仍然报错,是因为在spring-security-acl-2.0.4.jar包中有以下代码:
    private String classIdentityQuery = "call identity()"; // should be overridden for postgres : select currval('acl_class_seq')
    private String sidIdentityQuery = "call identity()"; // should be overridden for postgres : select currval('acl_siq_seq')

在Mysql中,语句
引用
call identity()
不合法导致的,在mysql中合法的语句为:SELECT LAST_INSERT_ID()因此有必要修改要执行的语句。
    二.修改jar包中不合规范的语句,改为文件:DataSourcePopulator.java在177行后加入如下代码:
                    	if(mutableAclService instanceof JdbcMutableAclService)
                    	{
                    		((JdbcMutableAclService) mutableAclService).setClassIdentityQuery("SELECT LAST_INSERT_ID()");
                    		((JdbcMutableAclService) mutableAclService).setSidIdentityQuery("SELECT LAST_INSERT_ID()");
                    	}

再次运行一切正常。
修改后的全部代码如下:
/* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package sample.contact;

import org.springframework.security.Authentication;
import org.springframework.security.GrantedAuthority;
import org.springframework.security.GrantedAuthorityImpl;

import org.springframework.security.acls.MutableAcl;
import org.springframework.security.acls.MutableAclService;
import org.springframework.security.acls.Permission;
import org.springframework.security.acls.domain.AclImpl;
import org.springframework.security.acls.domain.BasePermission;
import org.springframework.security.acls.jdbc.JdbcMutableAclService;
import org.springframework.security.acls.objectidentity.ObjectIdentity;
import org.springframework.security.acls.objectidentity.ObjectIdentityImpl;
import org.springframework.security.acls.sid.PrincipalSid;

import org.springframework.security.context.SecurityContextHolder;

import org.springframework.security.providers.UsernamePasswordAuthenticationToken;

import org.springframework.beans.factory.InitializingBean;

import org.springframework.jdbc.core.JdbcTemplate;

import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.TransactionCallback;
import org.springframework.transaction.support.TransactionTemplate;

import org.springframework.util.Assert;

import java.util.Random;

import javax.sql.DataSource;


/**
 * Populates the Contacts in-memory database with contact and ACL information.
 *
 * @author Ben Alex
 * @version $Id: DataSourcePopulator.java 2872 2008-04-05 20:43:10Z benalex $
 */
public class DataSourcePopulator implements InitializingBean {
    //~ Instance fields ================================================================================================

    JdbcTemplate template;
    private MutableAclService mutableAclService;
    Random rnd = new Random();
    TransactionTemplate tt;
    String[] firstNames = {
            "Bob", "Mary", "James", "Jane", "Kristy", "Kirsty", "Kate", "Jeni", "Angela", "Melanie", "Kent", "William",
            "Geoff", "Jeff", "Adrian", "Amanda", "Lisa", "Elizabeth", "Prue", "Richard", "Darin", "Phillip", "Michael",
            "Belinda", "Samantha", "Brian", "Greg", "Matthew"
        };
    String[] lastNames = {
            "Smith", "Williams", "Jackson", "Rictor", "Nelson", "Fitzgerald", "McAlpine", "Sutherland", "Abbott", "Hall",
            "Edwards", "Gates", "Black", "Brown", "Gray", "Marwell", "Booch", "Johnson", "McTaggart", "Parklin",
            "Findlay", "Robinson", "Giugni", "Lang", "Chi", "Carmichael"
        };
    private int createEntities = 50;

    //~ Methods ========================================================================================================

    public void afterPropertiesSet() throws Exception {
        Assert.notNull(mutableAclService, "mutableAclService required");
        Assert.notNull(template, "dataSource required");
        Assert.notNull(tt, "platformTransactionManager required");

        // Set a user account that will initially own all the created data
        Authentication authRequest = new UsernamePasswordAuthenticationToken("rod", "koala",
                new GrantedAuthority[] {new GrantedAuthorityImpl("ROLE_IGNORED")});
        SecurityContextHolder.getContext().setAuthentication(authRequest);

        template.execute(
            "CREATE TABLE ACL_SID(" +
                    "ID BIGINT NOT NULL AUTO_INCREMENT," +
                    "PRINCIPAL BOOLEAN NOT NULL," +
                    "SID VARCHAR(100) NOT NULL," +
                    "CONSTRAINT UNIQUE_UK_1 UNIQUE(SID,PRINCIPAL)," +
                    "PRIMARY KEY (ID)) AUTO_INCREMENT=100;");
        template.execute(
            "CREATE TABLE ACL_CLASS(" +
                    "ID BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY," +
                    "CLASS VARCHAR(100) NOT NULL," +
                    "CONSTRAINT UNIQUE_UK_2 UNIQUE(CLASS)) AUTO_INCREMENT=100;");
        template.execute(
            "CREATE TABLE ACL_OBJECT_IDENTITY(" +
                    "ID BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY," +
                    "OBJECT_ID_CLASS BIGINT NOT NULL," +
                    "OBJECT_ID_IDENTITY BIGINT NOT NULL," +
                    "PARENT_OBJECT BIGINT," +
                    "OWNER_SID BIGINT," +
                    "ENTRIES_INHERITING BOOLEAN NOT NULL," +
                    "CONSTRAINT UNIQUE_UK_3 UNIQUE(OBJECT_ID_CLASS,OBJECT_ID_IDENTITY)," +
                    "CONSTRAINT FOREIGN_FK_1 FOREIGN KEY(PARENT_OBJECT)REFERENCES ACL_OBJECT_IDENTITY(ID)," +
                    "CONSTRAINT FOREIGN_FK_2 FOREIGN KEY(OBJECT_ID_CLASS)REFERENCES ACL_CLASS(ID)," +
                    "CONSTRAINT FOREIGN_FK_3 FOREIGN KEY(OWNER_SID)REFERENCES ACL_SID(ID)) AUTO_INCREMENT=100;");
        template.execute(
            "CREATE TABLE ACL_ENTRY(" +
                    "ID BIGINT AUTO_INCREMENT NOT NULL PRIMARY KEY," +
                    "ACL_OBJECT_IDENTITY BIGINT NOT NULL,ACE_ORDER INT NOT NULL,SID BIGINT NOT NULL," +
                    "MASK INTEGER NOT NULL,GRANTING BOOLEAN NOT NULL,AUDIT_SUCCESS BOOLEAN NOT NULL," +
                    "AUDIT_FAILURE BOOLEAN NOT NULL,CONSTRAINT UNIQUE_UK_4 UNIQUE(ACL_OBJECT_IDENTITY,ACE_ORDER)," +
                    "CONSTRAINT FOREIGN_FK_4 FOREIGN KEY(ACL_OBJECT_IDENTITY) REFERENCES ACL_OBJECT_IDENTITY(ID)," +
                    "CONSTRAINT FOREIGN_FK_5 FOREIGN KEY(SID) REFERENCES ACL_SID(ID)) AUTO_INCREMENT=100;");

        template.execute(
            "CREATE TABLE USERS(USERNAME VARCHAR(50) NOT NULL PRIMARY KEY,PASSWORD VARCHAR(50) NOT NULL,ENABLED BOOLEAN NOT NULL);");
        template.execute(
            "CREATE TABLE AUTHORITIES(USERNAME VARCHAR(50) NOT NULL,AUTHORITY VARCHAR(50) NOT NULL,CONSTRAINT FK_AUTHORITIES_USERS FOREIGN KEY(USERNAME) REFERENCES USERS(USERNAME));");
        template.execute("CREATE UNIQUE INDEX IX_AUTH_USERNAME ON AUTHORITIES(USERNAME,AUTHORITY);");

        template.execute(
            "CREATE TABLE CONTACTS(ID BIGINT NOT NULL PRIMARY KEY, CONTACT_NAME VARCHAR(50) NOT NULL, EMAIL VARCHAR(50) NOT NULL)");

        /*
           Passwords encoded using MD5, NOT in Base64 format, with null as salt
           Encoded password for rod is "koala"
           Encoded password for dianne is "emu"
           Encoded password for scott is "wombat"
           Encoded password for peter is "opal" (but user is disabled)
           Encoded password for bill is "wombat"
           Encoded password for bob is "wombat"
           Encoded password for jane is "wombat"

         */
        template.execute("INSERT INTO USERS VALUES('rod','a564de63c2d0da68cf47586ee05984d7',TRUE);");
        template.execute("INSERT INTO USERS VALUES('dianne','65d15fe9156f9c4bbffd98085992a44e',TRUE);");
        template.execute("INSERT INTO USERS VALUES('scott','2b58af6dddbd072ed27ffc86725d7d3a',TRUE);");
        template.execute("INSERT INTO USERS VALUES('peter','22b5c9accc6e1ba628cedc63a72d57f8',FALSE);");
        template.execute("INSERT INTO USERS VALUES('bill','2b58af6dddbd072ed27ffc86725d7d3a',TRUE);");
        template.execute("INSERT INTO USERS VALUES('bob','2b58af6dddbd072ed27ffc86725d7d3a',TRUE);");
        template.execute("INSERT INTO USERS VALUES('jane','2b58af6dddbd072ed27ffc86725d7d3a',TRUE);");
        template.execute("INSERT INTO AUTHORITIES VALUES('rod','ROLE_USER');");
        template.execute("INSERT INTO AUTHORITIES VALUES('rod','ROLE_SUPERVISOR');");
        template.execute("INSERT INTO AUTHORITIES VALUES('dianne','ROLE_USER');");
        template.execute("INSERT INTO AUTHORITIES VALUES('scott','ROLE_USER');");
        template.execute("INSERT INTO AUTHORITIES VALUES('peter','ROLE_USER');");
        template.execute("INSERT INTO AUTHORITIES VALUES('bill','ROLE_USER');");
        template.execute("INSERT INTO AUTHORITIES VALUES('bob','ROLE_USER');");
        template.execute("INSERT INTO AUTHORITIES VALUES('jane','ROLE_USER');");

        template.execute("INSERT INTO contacts VALUES (1, 'John Smith', 'john@somewhere.com');");
        template.execute("INSERT INTO contacts VALUES (2, 'Michael Citizen', 'michael@xyz.com');");
        template.execute("INSERT INTO contacts VALUES (3, 'Joe Bloggs', 'joe@demo.com');");
        template.execute("INSERT INTO contacts VALUES (4, 'Karen Sutherland', 'karen@sutherland.com');");
        template.execute("INSERT INTO contacts VALUES (5, 'Mitchell Howard', 'mitchell@abcdef.com');");
        template.execute("INSERT INTO contacts VALUES (6, 'Rose Costas', 'rose@xyz.com');");
        template.execute("INSERT INTO contacts VALUES (7, 'Amanda Smith', 'amanda@abcdef.com');");
        template.execute("INSERT INTO contacts VALUES (8, 'Cindy Smith', 'cindy@smith.com');");
        template.execute("INSERT INTO contacts VALUES (9, 'Jonathan Citizen', 'jonathan@xyz.com');");

        for (int i = 10; i < createEntities; i++) {
            String[] person = selectPerson();
            template.execute("INSERT INTO contacts VALUES (" + i + ", '" + person[2] + "', '" + person[0].toLowerCase()
                + "@" + person[1].toLowerCase() + ".com');");
        }

        // Create acl_object_identity rows (and also acl_class rows as needed
        for (int i = 1; i < createEntities; i++) {
            final ObjectIdentity objectIdentity = new ObjectIdentityImpl(Contact.class, new Long(i));
            tt.execute(new TransactionCallback() {
                    public Object doInTransaction(TransactionStatus arg0) {
                    	//If datasource is Mysql db
                    	if(mutableAclService instanceof JdbcMutableAclService)
                    	{
                    		((JdbcMutableAclService) mutableAclService).setClassIdentityQuery("SELECT LAST_INSERT_ID()");
                    		((JdbcMutableAclService) mutableAclService).setSidIdentityQuery("SELECT LAST_INSERT_ID()");
                    	}
                        MutableAcl acl = mutableAclService.createAcl(objectIdentity);

                        return null;
                    }
                });
        }

        // Now grant some permissions
        grantPermissions(1, "rod", BasePermission.ADMINISTRATION);
        grantPermissions(2, "rod", BasePermission.READ);
        grantPermissions(3, "rod", BasePermission.READ);
        grantPermissions(3, "rod", BasePermission.WRITE);
        grantPermissions(3, "rod", BasePermission.DELETE);
        grantPermissions(4, "rod", BasePermission.ADMINISTRATION);
        grantPermissions(4, "dianne", BasePermission.ADMINISTRATION);
        grantPermissions(4, "scott", BasePermission.READ);
        grantPermissions(5, "dianne", BasePermission.ADMINISTRATION);
        grantPermissions(5, "dianne", BasePermission.READ);
        grantPermissions(6, "dianne", BasePermission.READ);
        grantPermissions(6, "dianne", BasePermission.WRITE);
        grantPermissions(6, "dianne", BasePermission.DELETE);
        grantPermissions(6, "scott", BasePermission.READ);
        grantPermissions(7, "scott", BasePermission.ADMINISTRATION);
        grantPermissions(8, "dianne", BasePermission.ADMINISTRATION);
        grantPermissions(8, "dianne", BasePermission.READ);
        grantPermissions(8, "scott", BasePermission.READ);
        grantPermissions(9, "scott", BasePermission.ADMINISTRATION);
        grantPermissions(9, "scott", BasePermission.READ);
        grantPermissions(9, "scott", BasePermission.WRITE);
        grantPermissions(9, "scott", BasePermission.DELETE);

        // Now expressly change the owner of the first ten contacts
        // We have to do this last, because "rod" owns all of them (doing it sooner would prevent ACL updates)
        // Note that ownership has no impact on permissions - they're separate (ownership only allows ACl editing)
        changeOwner(5, "dianne");
        changeOwner(6, "dianne");
        changeOwner(7, "scott");
        changeOwner(8, "dianne");
        changeOwner(9, "scott");

        String[] users = {"bill", "bob", "jane"}; // don't want to mess around with consistent sample data
        Permission[] permissions = {BasePermission.ADMINISTRATION, BasePermission.READ, BasePermission.DELETE};

        for (int i = 10; i < createEntities; i++) {
            String user = users[rnd.nextInt(users.length)];
            Permission permission = permissions[rnd.nextInt(permissions.length)];
            grantPermissions(i, user, permission);

            String user2 = users[rnd.nextInt(users.length)];
            Permission permission2 = permissions[rnd.nextInt(permissions.length)];
            grantPermissions(i, user2, permission2);
        }

        SecurityContextHolder.clearContext();
    }

    private void changeOwner(int contactNumber, String newOwnerUsername) {
        AclImpl acl = (AclImpl) mutableAclService.readAclById(new ObjectIdentityImpl(Contact.class,
                    new Long(contactNumber)));
        acl.setOwner(new PrincipalSid(newOwnerUsername));
        updateAclInTransaction(acl);
    }

    public int getCreateEntities() {
        return createEntities;
    }

    private void grantPermissions(int contactNumber, String recipientUsername, Permission permission) {
        AclImpl acl = (AclImpl) mutableAclService.readAclById(new ObjectIdentityImpl(Contact.class,
                    new Long(contactNumber)));
        acl.insertAce(acl.getEntries().length, permission, new PrincipalSid(recipientUsername), true);
        updateAclInTransaction(acl);
    }

    private String[] selectPerson() {
        String firstName = firstNames[rnd.nextInt(firstNames.length)];
        String lastName = lastNames[rnd.nextInt(lastNames.length)];

        return new String[] {firstName, lastName, firstName + " " + lastName};
    }

    public void setCreateEntities(int createEntities) {
        this.createEntities = createEntities;
    }

    public void setDataSource(DataSource dataSource) {
        this.template = new JdbcTemplate(dataSource);
    }

    public void setMutableAclService(MutableAclService mutableAclService) {
        this.mutableAclService = mutableAclService;
    }

    public void setPlatformTransactionManager(PlatformTransactionManager platformTransactionManager) {
        this.tt = new TransactionTemplate(platformTransactionManager);
    }

    private void updateAclInTransaction(final MutableAcl acl) {
        tt.execute(new TransactionCallback() {
                public Object doInTransaction(TransactionStatus arg0) {
                    mutableAclService.updateAcl(acl);

                    return null;
                }
            });
    }
}
分享到:
评论

相关推荐

    SpringMVC+Spring+MyBatis+MySql+Bootstrap+Jsp详细例程

    SpringMVC+Spring+MyBatis+MySql+Bootstrap+Jsp例程,后台由SSM框架实现,前端用JSP+Bootstrap+JS实现,数据库用MySql。 本例程注释清晰,代码格式规范,后台分层清楚,内含数据库创建SQl文件,适合新手参考,访问...

    SSH例程+MySql数据库

    Spring Security或者自定义的安全组件可以用于身份验证和授权。 通过这个示例,初学者可以学习到如何在SSH框架下整合MySQL数据库,理解MVC模式的工作原理,以及如何利用Hibernate进行ORM操作。同时,还能了解到如何...

    Springboot+mybatis的例程

    Spring Boot是由Pivotal团队提供的全新框架,其设计目标是简化新Spring应用的初始搭建以及开发过程。它预设了许多默认配置,如自动配置、内嵌Web服务器(如Tomcat)等,开发者无需繁琐的XML配置,可以快速启动项目。...

    大话西游II(网络例程+MYSQL+网页注册+客户端登录

    在本资源中,我们主要探讨的是它的网络例程、MySQL数据库运用、网页注册流程以及客户端登录机制,这些都是构建一个稳定、安全且用户友好的网络游戏的关键组成部分。 首先,网络例程是游戏运行的基础,它涉及到游戏...

    JAVA中spring详细知识,学习心得以及一个例程

    Spring 是一个开源的轻量级的 Java 开发框架,提供了全面的基础设施支持,可以帮助开发者快速构建企业级应用程序。Spring 框架的核心功能包括依赖注入(Dependency Injection)、面向切面编程(Aspect-Oriented ...

    易语言MYSQL例程

    易语言MYSQL例程

    spring mvc简单例程

    **Spring MVC 简单例程** 在本文中,我们将探讨如何在IntelliJ IDEA 14中使用Maven构建一个简单的Spring MVC项目,并结合MySQL数据库进行数据操作。首先,让我们了解一下Spring MVC的核心概念。 Spring MVC是...

    Spring+hibernate例程

    在这个例程中,文件名 "spring3" 可能指的是 Spring 3.x 版本的示例代码,这个版本是 Spring 框架的一个重要里程碑,引入了许多改进和新特性,例如支持更多的注解配置、更强大的 AOP 支持以及对 RESTful 风格的 Web ...

    易语言mysql数据库例程.rar

    易语言mysql数据库例程.rar 易语言mysql数据库例程.rar 易语言mysql数据库例程.rar 易语言mysql数据库例程.rar 易语言mysql数据库例程.rar 易语言mysql数据库例程.rar

    mysql_delphi操作mysql例程_

    本文将深入探讨如何使用Delphi与MySQL数据库进行交互,主要基于标题"mysql_delphi操作mysql例程_"和描述"delphi直接操作mysql的例程"中的关键信息。 首先,Delphi是一种面向对象的编程语言,它使用Pascal语法,并...

    VB+Mysql例程

    VB中通过MySQL C API函数库(libmysql.dll)操作Mysql的简单入门例子,不需要MyODBC。包含了libmysql.dll库。仔细研究吧! 重要说明:用户密码只能用旧版格式,即数据库中保存的密码是16个字符的。可以用old_password...

    Mysql.rar_MYSQL_MYSQL 例程

    在"MYSQL_MYSQL 例程"这个压缩包中,包含了关于如何在Linux环境下使用MySQL进行基本操作的示例程序。这些实例对于初学者或者想要在Linux系统下进行MySQL数据库应用开发的人来说,是非常宝贵的参考资料。 首先,我们...

    易语言mysql数据库例程

    在"易语言mysql数据库例程"中,我们主要探讨的是如何使用易语言来操作MySQL数据库,进行数据的读取、添加、修改和更新操作。 首先,让我们了解一下MySQL数据库。MySQL是一款开源、免费的关系型数据库管理系统,广泛...

    易语言源码mysql数据库例程.rar

    易语言源码mysql数据库例程.rar 易语言源码mysql数据库例程.rar 易语言源码mysql数据库例程.rar 易语言源码mysql数据库例程.rar 易语言源码mysql数据库例程.rar 易语言源码mysql数据库例程.rar易语言源码mysql...

    易语言mysql学习例程

    本压缩包文件“易语言mysql学习例程”提供了一套完整的源码,旨在帮助初学者掌握如何在易语言中与MySQL数据库进行交互。 MySQL是一个广泛使用的开源关系型数据库管理系统,它具有高性能、高可靠性以及易于使用的...

    SpringBoot、SpringCloud的各种集成例子大全

    SpringBoot集成Atomikos框架-实现分布式数据库XA事务;...SpringCloud集成Consul框架-实现配置中心; SpringCloud集成Consul框架-实现注册中心; SpringCloud集成Consul+Ribbon框架-实现注册中心和负载均衡; 等等

    Mysql EF Test_c#mysql例程_

    标题"Mysql EF Test_c#mysql例程_"表明这是一个关于C#和MySQL数据库操作的示例程序,其中可能包含Entity Framework的使用,一个流行的对象关系映射(ORM)框架。描述进一步确认了这是一个用于测试C#连接MySQL的程序...

Global site tag (gtag.js) - Google Analytics