Android+SSH开发商城App(1)数据库的创建和环境的搭建

项目简介

该项目主要是使用SSH开发Android后端服务器程序和前端App代码的实现,主要技术包含: Android AsyncTask 、常见自定义控件、客户端高层类封装、Android HTTP通信、用户管理、购物流程、定位、二维码等知识点,希望大家跟踪查看最新的学习笔记。

数据库的创建

数据库使用的是MySQL5.6版本,脚本代码如下:

;( `ID` bigint(20) NOT NULL AUTO_INCREMENT, , , PRIMARY KEY (`ID`)) ENGINE=InnoDB AUTO_INCREMENT=;( `ID` bigint(20) NOT NULL AUTO_INCREMENT, , , `updateDate` datetime DEFAULT NULL, , , , , PRIMARY KEY (`ID`)) ENGINE=InnoDB AUTO_INCREMENT=;( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `shopID` bigint(20) DEFAULT NULL, , , , , , , , , `productedDate` datetime DEFAULT NULL, `RegisterDate` datetime DEFAULT NULL, COMMENT ‘1为促销商品;0为普通商品’, `describes` text, PRIMARY KEY (`ID`)) ENGINE=InnoDB AUTO_INCREMENT=;( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `shopID` bigint(20) DEFAULT NULL, , , , COMMENT ‘1为显示,0为隐藏’, PRIMARY KEY (`ID`)) ENGINE=InnoDB ;( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `userID` bigint(20) DEFAULT NULL, , `scanTime` datetime DEFAULT NULL, PRIMARY KEY (`ID`)) ENGINE=InnoDB ;( `ID` bigint(20) NOT NULL AUTO_INCREMENT, , , , , , , , `describes` text, PRIMARY KEY (`ID`)) ENGINE=InnoDB AUTO_INCREMENT=;( `ID` bigint(20) NOT NULL AUTO_INCREMENT, , , , , `regtime` datetime DEFAULT NULL, PRIMARY KEY (`ID`)) ENGINE=InnoDB AUTO_INCREMENT=;.,,,,,,,,,,,,,,,,,,,,,() where (`goods`.`shopID` = `shop`.`ID`);

创建数据库如下:

SSH环境搭建

我们使用“纯手工”的方式搭建自己的SSH环境 (1)创建一个Web Project(可以根据下边的图片建立工程)

注意:当我们创建config_struts、config_spring、config文件的时候一定要在文件上点击右键build path–use as sources folder 这样的话,在编译的时候才会把这三个配置文件加入到class目录中,否则会找不到。加入之后的话就像我上图中的一样和src是同级目录的,上边有一个package的图标的样式!

(2)配置文件的简单介绍: log4j.properties

#log4j.rootLogger=INFO,stdoutlog4j4j.ConsoleAppenderlog4j=org.apache.log4j.PatternLayoutlog4j=%d %-5p [%t] %-17c{2} (%13F:%L) %3x – %m%n

applicationContext.xml

===” http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/tx/spring-tx-3.0.xsd”>==>===>>${datasource.url}=>>${datasource.password}>===>=======>===>========></tx:advice><!– <aop:config proxy-target-class=”true”><aop:pointcut expression=”execution(* com.lc.igou..*Services.*(..))” /><aop:advisor advice-ref=”txAdvice” pointcut-ref=”myPointcut” /></aop:config> –></beans>

jdbc.properties

datasource.type=mysqldatasourcedatasource.url=jdbc:mysql://localhost:3306/lcgou?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=UTF-8datasource.username=rootdatasource.password=1111datasource.maxActive=100datasource.maxIdle=2datasource.maxWait=120000datasource.whenExhaustedAction=1datasource.validationQuery=select 1 from dualdatasource.testOnBorrow=truedatasource.testOnReturn=false########################## c3p0 ############################c3p0.acquireIncrement=3c3p0.acquireRetryAttempts=30c3p0.acquireRetryDelay=100c3p0.initialPoolSize=3c3p0.idleConnectionTestPeriod=900c3p0.minPoolSize=2c3p0.maxPoolSize=10c3p0.maxStatements=0c3p0.numHelperThreads=10c3p0.maxIdleTime=30##################### Hibernate ##################################hibernatehibernate.jdbc.batch_size=25hibernate.jdbc.fetch_size=50hibernate.show_sql=truehibernate.connection.release_mode=after_transactionhibernate.format_sql=truehibernatehibernate.cache.use_query_cache=truehibernate.cache.use_second_level_cache=true空虚无聊的时候就读书,但一定得有自己的生活目标和计划。

Android+SSH开发商城App(1)数据库的创建和环境的搭建

相关文章:

你感兴趣的文章:

标签云: