目录

1.主配置文件

1.1定义

1.1.1分类

在hibernate的配置文件中,session-factory的配置下,分为三类

  • 连接配置:配置连接的参数
  • 其他配置:配置其他的需求,例如打印sql语句,自动建表
  • 映射配置:配置具体类的映射文件

    需要注意的是proterty字段需要在mapping字段之前

Demo:


  1. <!DOCTYPE hibernate-configuration PUBLIC
  2. "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
  3. "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
  4. <hibernate-configuration>
  5. <session-factory name="foo">
  6. <!-- 数据库连接配置 -->
  7. <!-- 连接类 -->
  8. <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
  9. <!-- 连接数据库 -->
  10. <property name="hibernate.connection.url">jdbc:mysql:///hi</property>
  11. <!-- 连接用户名 -->
  12. <property name="hibernate.connection.username">root</property>
  13. <!-- 连接密码 -->
  14. <property name="hibernate.connection.password">root</property>
  15. <!-- 数据库方言 -->
  16. <property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property>
  17. <!-- 其他配置 -->
  18. <property name="hibernate.show_sql"></property>
  19. <property name="hibernate.hbm2ddl.auto">create</property>
  20. <!-- 加载所有的映射 -->
  21. <mapping resource="per/liyue/code/hibernatehello/Employee.hbm.xml"/>
  22. </session-factory>
  23. </hibernate-configuration>

1.1.2分类

其中在其他配置项中可以配置创建或者更新的属性:

  • hibernate.hbm2ddl.auto create-drop 每次在创建sessionFactory时候执行创建表;

    当调用sesisonFactory的close方法的时候,删除表!
  • hibernate.hbm2ddl.auto create 每次都重新建表; 如果表已经存在就先删除再创建
  • hibernate.hbm2ddl.auto update 如果表不存在就创建; 表存在就不创建;
  • hibernate.hbm2ddl.auto validate (生成环境时候) 执行验证: 当映射文件的内容与数据库表结构不一样的时候就报错!

1.1.3不使用配置文件生成表

在hibernate.cfg.xml中,可以设定属性为自动生成表,但是这种加载方式在调用配置文件的时候才会生效,如果要按需加载。则需要用代码手动来实现。

  1. <!-- 将下面配置语句注释 -->
  2. <property name="hibernate.hbm2ddl.auto">create</property>

具体做法是在配置文件中注释自动生成的配置语句

  1. package per.liyue.code.hibernatehello;
  2. import org.hibernate.cfg.Configuration;
  3. import org.hibernate.tool.hbm2ddl.SchemaExport;
  4. import org.junit.Test;
  5. public class AppMuanal {
  6. @Test
  7. public void CreateTableManual(){
  8. //创建配置对象
  9. Configuration con = new Configuration();
  10. //加载配置文件
  11. con.configure();
  12. //获取工具类来实现创建表
  13. SchemaExport schemaExport = new SchemaExport(con);
  14. /*
  15. * create的第一个参数表示是否显示sql语句
  16. * create的第二个参数表示是否创建表
  17. */
  18. schemaExport.create(true, true);
  19. }
  20. }

1.2教程

常用的配置在教程hibernate-distribution-3.6.0.Final\project\etc\hibernate.properties中。下面是内容

  1. ######################
  2. ### Query Language ###
  3. ######################
  4. ## define query language constants / function names
  5. hibernate.query.substitutions yes 'Y', no 'N'
  6. ## select the classic query parser
  7. #hibernate.query.factory_class org.hibernate.hql.classic.ClassicQueryTranslatorFactory
  8. #################
  9. ### Platforms ###
  10. #################
  11. ## JNDI Datasource
  12. #hibernate.connection.datasource jdbc/test
  13. #hibernate.connection.username db2
  14. #hibernate.connection.password db2
  15. ## HypersonicSQL
  16. hibernate.dialect org.hibernate.dialect.HSQLDialect
  17. hibernate.connection.driver_class org.hsqldb.jdbcDriver
  18. hibernate.connection.username sa
  19. hibernate.connection.password
  20. hibernate.connection.url jdbc:hsqldb:./build/db/hsqldb/hibernate
  21. #hibernate.connection.url jdbc:hsqldb:hsql://localhost
  22. #hibernate.connection.url jdbc:hsqldb:test
  23. ## H2 (www.h2database.com)
  24. #hibernate.dialect org.hibernate.dialect.H2Dialect
  25. #hibernate.connection.driver_class org.h2.Driver
  26. #hibernate.connection.username sa
  27. #hibernate.connection.password
  28. #hibernate.connection.url jdbc:h2:mem:./build/db/h2/hibernate
  29. #hibernate.connection.url jdbc:h2:testdb/h2test
  30. #hibernate.connection.url jdbc:h2:mem:imdb1
  31. #hibernate.connection.url jdbc:h2:tcp://dbserv:8084/sample;
  32. #hibernate.connection.url jdbc:h2:ssl://secureserv:8085/sample;
  33. #hibernate.connection.url jdbc:h2:ssl://secureserv/testdb;cipher=AES
  34. ## MySQL
  35. #hibernate.dialect org.hibernate.dialect.MySQLDialect
  36. #hibernate.dialect org.hibernate.dialect.MySQLInnoDBDialect
  37. #hibernate.dialect org.hibernate.dialect.MySQLMyISAMDialect
  38. #hibernate.connection.driver_class com.mysql.jdbc.Driver
  39. #hibernate.connection.url jdbc:mysql:///test
  40. #hibernate.connection.username gavin
  41. #hibernate.connection.password
  42. ## Oracle
  43. #hibernate.dialect org.hibernate.dialect.Oracle8iDialect
  44. #hibernate.dialect org.hibernate.dialect.Oracle9iDialect
  45. #hibernate.dialect org.hibernate.dialect.Oracle10gDialect
  46. #hibernate.connection.driver_class oracle.jdbc.driver.OracleDriver
  47. #hibernate.connection.username ora
  48. #hibernate.connection.password ora
  49. #hibernate.connection.url jdbc:oracle:thin:@localhost:1521:orcl
  50. #hibernate.connection.url jdbc:oracle:thin:@localhost:1522:XE
  51. ## PostgreSQL
  52. #hibernate.dialect org.hibernate.dialect.PostgreSQLDialect
  53. #hibernate.connection.driver_class org.postgresql.Driver
  54. #hibernate.connection.url jdbc:postgresql:template1
  55. #hibernate.connection.username pg
  56. #hibernate.connection.password
  57. ## DB2
  58. #hibernate.dialect org.hibernate.dialect.DB2Dialect
  59. #hibernate.connection.driver_class com.ibm.db2.jcc.DB2Driver
  60. #hibernate.connection.driver_class COM.ibm.db2.jdbc.app.DB2Driver
  61. #hibernate.connection.url jdbc:db2://localhost:50000/somename
  62. #hibernate.connection.url jdbc:db2:somename
  63. #hibernate.connection.username db2
  64. #hibernate.connection.password db2
  65. ## TimesTen
  66. #hibernate.dialect org.hibernate.dialect.TimesTenDialect
  67. #hibernate.connection.driver_class com.timesten.jdbc.TimesTenDriver
  68. #hibernate.connection.url jdbc:timesten:direct:test
  69. #hibernate.connection.username
  70. #hibernate.connection.password
  71. ## DB2/400
  72. #hibernate.dialect org.hibernate.dialect.DB2400Dialect
  73. #hibernate.connection.username user
  74. #hibernate.connection.password password
  75. ## Native driver
  76. #hibernate.connection.driver_class COM.ibm.db2.jdbc.app.DB2Driver
  77. #hibernate.connection.url jdbc:db2://systemname
  78. ## Toolbox driver
  79. #hibernate.connection.driver_class com.ibm.as400.access.AS400JDBCDriver
  80. #hibernate.connection.url jdbc:as400://systemname
  81. ## Derby (not supported!)
  82. #hibernate.dialect org.hibernate.dialect.DerbyDialect
  83. #hibernate.connection.driver_class org.apache.derby.jdbc.EmbeddedDriver
  84. #hibernate.connection.username
  85. #hibernate.connection.password
  86. #hibernate.connection.url jdbc:derby:build/db/derby/hibernate;create=true
  87. ## Sybase
  88. #hibernate.dialect org.hibernate.dialect.SybaseDialect
  89. #hibernate.connection.driver_class com.sybase.jdbc2.jdbc.SybDriver
  90. #hibernate.connection.username sa
  91. #hibernate.connection.password sasasa
  92. #hibernate.connection.url jdbc:sybase:Tds:co3061835-a:5000/tempdb
  93. ## Mckoi SQL
  94. #hibernate.dialect org.hibernate.dialect.MckoiDialect
  95. #hibernate.connection.driver_class com.mckoi.JDBCDriver
  96. #hibernate.connection.url jdbc:mckoi:///
  97. #hibernate.connection.url jdbc:mckoi:local://C:/mckoi1.0.3/db.conf
  98. #hibernate.connection.username admin
  99. #hibernate.connection.password nimda
  100. ## SAP DB
  101. #hibernate.dialect org.hibernate.dialect.SAPDBDialect
  102. #hibernate.connection.driver_class com.sap.dbtech.jdbc.DriverSapDB
  103. #hibernate.connection.url jdbc:sapdb://localhost/TST
  104. #hibernate.connection.username TEST
  105. #hibernate.connection.password TEST
  106. #hibernate.query.substitutions yes 'Y', no 'N'
  107. ## MS SQL Server
  108. #hibernate.dialect org.hibernate.dialect.SQLServerDialect
  109. #hibernate.connection.username sa
  110. #hibernate.connection.password sa
  111. ## JSQL Driver
  112. #hibernate.connection.driver_class com.jnetdirect.jsql.JSQLDriver
  113. #hibernate.connection.url jdbc:JSQLConnect://1E1/test
  114. ## JTURBO Driver
  115. #hibernate.connection.driver_class com.newatlanta.jturbo.driver.Driver
  116. #hibernate.connection.url jdbc:JTurbo://1E1:1433/test
  117. ## WebLogic Driver
  118. #hibernate.connection.driver_class weblogic.jdbc.mssqlserver4.Driver
  119. #hibernate.connection.url jdbc:weblogic:mssqlserver4:1E1:1433
  120. ## Microsoft Driver (not recommended!)
  121. #hibernate.connection.driver_class com.microsoft.jdbc.sqlserver.SQLServerDriver
  122. #hibernate.connection.url jdbc:microsoft:sqlserver://1E1;DatabaseName=test;SelectMethod=cursor
  123. ## The New Microsoft Driver
  124. #hibernate.connection.driver_class com.microsoft.sqlserver.jdbc.SQLServerDriver
  125. #hibernate.connection.url jdbc:sqlserver://localhost
  126. ## jTDS (since version 0.9)
  127. #hibernate.connection.driver_class net.sourceforge.jtds.jdbc.Driver
  128. #hibernate.connection.url jdbc:jtds:sqlserver://1E1/test
  129. ## Interbase
  130. #hibernate.dialect org.hibernate.dialect.InterbaseDialect
  131. #hibernate.connection.username sysdba
  132. #hibernate.connection.password masterkey
  133. ## DO NOT specify hibernate.connection.sqlDialect
  134. ## InterClient
  135. #hibernate.connection.driver_class interbase.interclient.Driver
  136. #hibernate.connection.url jdbc:interbase://localhost:3060/C:/firebird/test.gdb
  137. ## Pure Java
  138. #hibernate.connection.driver_class org.firebirdsql.jdbc.FBDriver
  139. #hibernate.connection.url jdbc:firebirdsql:localhost/3050:/firebird/test.gdb
  140. ## Pointbase
  141. #hibernate.dialect org.hibernate.dialect.PointbaseDialect
  142. #hibernate.connection.driver_class com.pointbase.jdbc.jdbcUniversalDriver
  143. #hibernate.connection.url jdbc:pointbase:embedded:sample
  144. #hibernate.connection.username PBPUBLIC
  145. #hibernate.connection.password PBPUBLIC
  146. ## Ingres
  147. ## older versions (before Ingress 2006)
  148. #hibernate.dialect org.hibernate.dialect.IngresDialect
  149. #hibernate.connection.driver_class ca.edbc.jdbc.EdbcDriver
  150. #hibernate.connection.url jdbc:edbc://localhost:II7/database
  151. #hibernate.connection.username user
  152. #hibernate.connection.password password
  153. ## Ingres 2006 or later
  154. #hibernate.dialect org.hibernate.dialect.IngresDialect
  155. #hibernate.connection.driver_class com.ingres.jdbc.IngresDriver
  156. #hibernate.connection.url jdbc:ingres://localhost:II7/database;CURSOR=READONLY;auto=multi
  157. #hibernate.connection.username user
  158. #hibernate.connection.password password
  159. ## Mimer SQL
  160. #hibernate.dialect org.hibernate.dialect.MimerSQLDialect
  161. #hibernate.connection.driver_class com.mimer.jdbc.Driver
  162. #hibernate.connection.url jdbc:mimer:multi1
  163. #hibernate.connection.username hibernate
  164. #hibernate.connection.password hibernate
  165. ## InterSystems Cache
  166. #hibernate.dialect org.hibernate.dialect.Cache71Dialect
  167. #hibernate.connection.driver_class com.intersys.jdbc.CacheDriver
  168. #hibernate.connection.username _SYSTEM
  169. #hibernate.connection.password SYS
  170. #hibernate.connection.url jdbc:Cache://127.0.0.1:1972/HIBERNATE
  171. #################################
  172. ### Hibernate Connection Pool ###
  173. #################################
  174. hibernate.connection.pool_size 1
  175. ###########################
  176. ### C3P0 Connection Pool###
  177. ###########################
  178. #hibernate.c3p0.max_size 2
  179. #hibernate.c3p0.min_size 2
  180. #hibernate.c3p0.timeout 5000
  181. #hibernate.c3p0.max_statements 100
  182. #hibernate.c3p0.idle_test_period 3000
  183. #hibernate.c3p0.acquire_increment 2
  184. #hibernate.c3p0.validate false
  185. ##############################
  186. ### Proxool Connection Pool###
  187. ##############################
  188. ## Properties for external configuration of Proxool
  189. hibernate.proxool.pool_alias pool1
  190. ## Only need one of the following
  191. #hibernate.proxool.existing_pool true
  192. #hibernate.proxool.xml proxool.xml
  193. #hibernate.proxool.properties proxool.properties
  194. #################################
  195. ### Plugin ConnectionProvider ###
  196. #################################
  197. ## use a custom ConnectionProvider (if not set, Hibernate will choose a built-in ConnectionProvider using hueristics)
  198. #hibernate.connection.provider_class org.hibernate.connection.DriverManagerConnectionProvider
  199. #hibernate.connection.provider_class org.hibernate.connection.DatasourceConnectionProvider
  200. #hibernate.connection.provider_class org.hibernate.connection.C3P0ConnectionProvider
  201. #hibernate.connection.provider_class org.hibernate.connection.ProxoolConnectionProvider
  202. #######################
  203. ### Transaction API ###
  204. #######################
  205. ## Enable automatic flush during the JTA beforeCompletion() callback
  206. ## (This setting is relevant with or without the Transaction API)
  207. #hibernate.transaction.flush_before_completion
  208. ## Enable automatic session close at the end of transaction
  209. ## (This setting is relevant with or without the Transaction API)
  210. #hibernate.transaction.auto_close_session
  211. ## the Transaction API abstracts application code from the underlying JTA or JDBC transactions
  212. #hibernate.transaction.factory_class org.hibernate.transaction.JTATransactionFactory
  213. #hibernate.transaction.factory_class org.hibernate.transaction.JDBCTransactionFactory
  214. ## to use JTATransactionFactory, Hibernate must be able to locate the UserTransaction in JNDI
  215. ## default is java:comp/UserTransaction
  216. ## you do NOT need this setting if you specify hibernate.transaction.manager_lookup_class
  217. #jta.UserTransaction jta/usertransaction
  218. #jta.UserTransaction javax.transaction.UserTransaction
  219. #jta.UserTransaction UserTransaction
  220. ## to use the second-level cache with JTA, Hibernate must be able to obtain the JTA TransactionManager
  221. #hibernate.transaction.manager_lookup_class org.hibernate.transaction.JBossTransactionManagerLookup
  222. #hibernate.transaction.manager_lookup_class org.hibernate.transaction.WeblogicTransactionManagerLookup
  223. #hibernate.transaction.manager_lookup_class org.hibernate.transaction.WebSphereTransactionManagerLookup
  224. #hibernate.transaction.manager_lookup_class org.hibernate.transaction.OrionTransactionManagerLookup
  225. #hibernate.transaction.manager_lookup_class org.hibernate.transaction.ResinTransactionManagerLookup
  226. ##############################
  227. ### Miscellaneous Settings ###
  228. ##############################
  229. ## print all generated SQL to the console
  230. #hibernate.show_sql true
  231. ## format SQL in log and console
  232. hibernate.format_sql true
  233. ## add comments to the generated SQL
  234. #hibernate.use_sql_comments true
  235. ## generate statistics
  236. #hibernate.generate_statistics true
  237. ## auto schema export
  238. #hibernate.hbm2ddl.auto create-drop
  239. #hibernate.hbm2ddl.auto create
  240. #hibernate.hbm2ddl.auto update
  241. #hibernate.hbm2ddl.auto validate
  242. ## specify a default schema and catalog for unqualified tablenames
  243. #hibernate.default_schema test
  244. #hibernate.default_catalog test
  245. ## enable ordering of SQL UPDATEs by primary key
  246. #hibernate.order_updates true
  247. ## set the maximum depth of the outer join fetch tree
  248. hibernate.max_fetch_depth 1
  249. ## set the default batch size for batch fetching
  250. #hibernate.default_batch_fetch_size 8
  251. ## rollback generated identifier values of deleted entities to default values
  252. #hibernate.use_identifer_rollback true
  253. ## enable bytecode reflection optimizer (disabled by default)
  254. #hibernate.bytecode.use_reflection_optimizer true
  255. #####################
  256. ### JDBC Settings ###
  257. #####################
  258. ## specify a JDBC isolation level
  259. #hibernate.connection.isolation 4
  260. ## enable JDBC autocommit (not recommended!)
  261. #hibernate.connection.autocommit true
  262. ## set the JDBC fetch size
  263. #hibernate.jdbc.fetch_size 25
  264. ## set the maximum JDBC 2 batch size (a nonzero value enables batching)
  265. #hibernate.jdbc.batch_size 5
  266. #hibernate.jdbc.batch_size 0
  267. ## enable batch updates even for versioned data
  268. hibernate.jdbc.batch_versioned_data true
  269. ## enable use of JDBC 2 scrollable ResultSets (specifying a Dialect will cause Hibernate to use a sensible default)
  270. #hibernate.jdbc.use_scrollable_resultset true
  271. ## use streams when writing binary types to / from JDBC
  272. hibernate.jdbc.use_streams_for_binary true
  273. ## use JDBC 3 PreparedStatement.getGeneratedKeys() to get the identifier of an inserted row
  274. #hibernate.jdbc.use_get_generated_keys false
  275. ## choose a custom JDBC batcher
  276. # hibernate.jdbc.factory_class
  277. ## enable JDBC result set column alias caching
  278. ## (minor performance enhancement for broken JDBC drivers)
  279. # hibernate.jdbc.wrap_result_sets
  280. ## choose a custom SQL exception converter
  281. #hibernate.jdbc.sql_exception_converter
  282. ##########################
  283. ### Second-level Cache ###
  284. ##########################
  285. ## optimize chache for minimal "puts" instead of minimal "gets" (good for clustered cache)
  286. #hibernate.cache.use_minimal_puts true
  287. ## set a prefix for cache region names
  288. hibernate.cache.region_prefix hibernate.test
  289. ## disable the second-level cache
  290. #hibernate.cache.use_second_level_cache false
  291. ## enable the query cache
  292. #hibernate.cache.use_query_cache true
  293. ## store the second-level cache entries in a more human-friendly format
  294. #hibernate.cache.use_structured_entries true
  295. ## choose a cache implementation
  296. #hibernate.cache.provider_class org.hibernate.cache.EhCacheProvider
  297. #hibernate.cache.provider_class org.hibernate.cache.EmptyCacheProvider
  298. hibernate.cache.provider_class org.hibernate.cache.HashtableCacheProvider
  299. #hibernate.cache.provider_class org.hibernate.cache.TreeCacheProvider
  300. #hibernate.cache.provider_class org.hibernate.cache.OSCacheProvider
  301. #hibernate.cache.provider_class org.hibernate.cache.SwarmCacheProvider
  302. ## choose a custom query cache implementation
  303. #hibernate.cache.query_cache_factory
  304. ############
  305. ### JNDI ###
  306. ############
  307. ## specify a JNDI name for the SessionFactory
  308. #hibernate.session_factory_name hibernate/session_factory
  309. ## Hibernate uses JNDI to bind a name to a SessionFactory and to look up the JTA UserTransaction;
  310. ## if hibernate.jndi.* are not specified, Hibernate will use the default InitialContext() which
  311. ## is the best approach in an application server
  312. #file system
  313. #hibernate.jndi.class com.sun.jndi.fscontext.RefFSContextFactory
  314. #hibernate.jndi.url file:/
  315. #WebSphere
  316. #hibernate.jndi.class com.ibm.websphere.naming.WsnInitialContextFactory
  317. #hibernate.jndi.url iiop://localhost:900/

2. 映射配置文件

25.Hibernate-配置文件.md的更多相关文章

  1. [原创]java WEB学习笔记80:Hibernate学习之路--- hibernate配置文件:JDBC 连接属性,C3P0 数据库连接池属性等

    本博客的目的:①总结自己的学习过程,相当于学习笔记 ②将自己的经验分享给大家,相互学习,互相交流,不可商用 内容难免出现问题,欢迎指正,交流,探讨,可以留言,也可以通过以下方式联系. 本人互联网技术爱 ...

  2. Hibernate配置文件解释

    Hibernate配置文件主要用于配置数据库连接和Hibernate运行时所需的各种属性每个Hibernate配置文件对应一个Configuration对象Hibernate配置文件可以有两种格式: ...

  3. 连接Oracle数据库的Hibernate配置文件

    连接Oracle数据库的Hibernate配置文件连接Oracle的Hibernate配置文件有两种格式,一种是xml格式的,另一种是Java属性文件格式的.下面分别给出这两种格式配置文件的代码. 1 ...

  4. Hibernate 配置文件的基础配置

    Hibernate 配置文件主要用于配置数据库连接和 Hibernate运行时所需的各种属性 每个 Hibernate 配置文件对应一个 Configuration 对象 Hibernate.cfg. ...

  5. Spring配置文件集成Hibernate配置文件

      Spring对hibernate配置文件hibernate.cfg.xml的集成,来取代hibernate.cfg.xml的配置.  spring对hibernate配置文件hibernate.c ...

  6. hibernate配置文件hibernate.cfg.xml和.hbm.xml的详细解释

    原文地址:http://blog.csdn.net/qiaqia609/article/details/9456489 hibernate.cfg.xml -标准的XML文件的起始行,version= ...

  7. hibernate配置文件详细解析

    在javaweb开发中,hibernate框架的是常用的,能帮我们节省大量的时间,以下是hibernate的配置文件解析. hibernate配置文件的默认名为:hibernate.cfg.xml 默 ...

  8. hibernate配置文件hibernate.cfg.xml的详细解释

    <!--标准的XML文件的起始行,version='1.0'表明XML的版本,encoding='gb2312'表明XML文件的编码方式-->                 <?x ...

  9. Hibernate —— Hibernate 配置文件

    1.Hibernate 配置文件主要用于配置**数据库连接**和 Hibernate 运行时所需的**各种属性**. 2.每一个 Hibernate 配置文件对应一个 Configuration 对象 ...

  10. Hibernate 配置文件与映射文件 总结

    hibernate是一个彻底的ORM(Object Relational Mapping,对象关系映射)开源框架. 一.Hibernate配置文件详解 Hibernate配置文件有两种形式:XML与p ...

随机推荐

  1. ecmall 后台添加新菜单

    所谓的开发新菜单,其实是和开发模块相对比的,之前说的开发模块,是在应对较大的,或者较为复杂,又相对独立于其他功能的项目需求. 而开发菜单,就是简单的在后台增加一个一级菜单以及其子菜单,或者直接在现有的 ...

  2. MySQL - 常见的存储引擎

    数据库存储引擎是数据库底层软件组织,数据库管理系统(DBMS)使用数据引擎进行创建.查询.更新和删除数据,不同的存储引擎... 存储引擎 数据库存储引擎: 是数据库底层软件组织,数据库管理系统(DBM ...

  3. java-Calendar类

    1.Calendar类的概述和获取日期的方法 * A:Calendar类的概述 * Calendar 类是一个抽象类,它为特定瞬间与一组诸如 YEAR.MONTH.DAY_OF_MONTH.HOUR ...

  4. JavaScript中DOM(第二天)

    DOM document object model,文档对象模型,也叫dom树:dom是由节点组成的.html标签称为标签节点,属性称为属性节点: console.log(docment);即可输出d ...

  5. JavaScript数据类型(第一天)

    ECMAScript为JavaScript的标准,javascript为网景公司定义,但并不标准,所以欧洲的组织定义了ESMAScript,定义了网页脚本的标准. js组成 ECMAScript js ...

  6. php配置php_pdo_mysql模块

    网上的都是什么编译安装的,总算找到一个简单的方法 安装好PHP yum install php php-fpm -y 直接安装pdo模块 yum install php-pdo_mysql 在/etc ...

  7. design_patterns_in_typescript 学习

    https://github.com/torokmark/design_patterns_in_typescript Creational Singleton [A class of which on ...

  8. PHP如何判断一个数组是一维还是多维

    什么叫多维数组呢?多维数组,本质上是以数组作为数组元素的数组. 二维数组又称为矩阵,一个数组的元素如果是一维数组,那么我们就称这个数组是二维数组. 怎么判断一个数组是否是一维数组呢?通过count() ...

  9. 十三、springboot (八)Admin

    1.创建server端spring-boot-admin 2.添加依赖 <parent> <groupId>org.springframework.boot</group ...

  10. 将string转为同名类名,方法名。(c#反射)

    using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace stri ...