1.本文摘自|络Q看控g命名像是4.0以前的版本,但控件属性配|仍然可以借鉴Q不之处,以后目用到时再l完善)?/span>
配置:
maxValueQ列表中允许的最大时?nbsp;
maxTextQ当旉大于最大值时的错误提CZ?nbsp;
minValueQ列表中允许的最时?nbsp;
minTextQ当旉于最值时的错误提CZ?nbsp;
incrementQ两个相邻选项间的旉间隔Q默认ؓ15分钟
formatQ显C格式,默认?#8220;g:i A”。一般?#8220;H:i:s”
HQ带前缀0?4时
iQ带前缀0的分?nbsp;
sQ带前缀0的秒
invalidTextQ当旉值非法时昄的提CZ?nbsp;
altFormatsQ多个时间输入格式组成的字符Ԍ不同的格式之间?#8220;|”q行分割
animCollapseQ动L叠,默认为false
checkboxToggleQ设|是否显C字D集的checkbox选择框,默认为false
checkboxNameQ指定字D集中用于展开或隐藏字D集面板的checkbox的名字,该属性只有在checkboxToggle为true时生?nbsp;
labelWidthQ字D|{宽度Q可以联到子容?nbsp;
layoutQ布局Q默认ؓform
maxValueQ允讔R择的最大日?nbsp;
maxTextQ当日期大于最大值时的错误提CZ?nbsp;
minValueQ允讔R择的最时?nbsp;
minTextQ当日期于最值时的错误提CZ?nbsp;
formatQ日期显C格式,默认?#8220;m/d/y”Q一般?#8220;Y-m-d”
YQ四位年?nbsp;
mQ带前缀0的月?nbsp;
dQ带前缀0的日?nbsp;
yQ两位年?nbsp;
nQ不带前~0的月?nbsp;
jQ不带前~0的日?nbsp;
wQ星期的数字Q?表示星期日,1代表星期一
showTodayQ是否显CZ天按钮,默认为true
altFormatsQ多个日期输入格式组成的字符Ԍ不同的格式之间?#8220;|”q行分割Q默认gؓ'm/d/Y|n/j/Y|n/j/y|m/j /y|n/d/y|m/j/Y|n/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d'
disabledDatesQ禁止选择的日期组成的数组
disabledDatesTextQ选择选日期时昄的提CZ?nbsp;
disabledDaysQ禁止选择的星期组成的数组Q?代表星期日,1代表星期一
disabledDaysTextQ选择选星期时昄的提CZ?nbsp;
invalidTextQ当日期值非法时昄的提CZ?nbsp;
ҎQ?nbsp;
getValue()Q取得日期?/p>
displayFieldQ被昄在下拉框中的字段?nbsp;
editableQ是否可~辑Q默认ؓtrue
forceSelectionQ输入值是否严gؓ待选列表中存在的倹{如果输入不存在的|会自动选择W一个最接近的倹{?nbsp;
hiddenNameQ隐藏字D늚名字Q如果提供该参数则一个隐藏字D将被创建,用来存储所选|当表单提交时在服务器端可以通过该名字取得列表中的所选?nbsp;
listWidthQ下拉列表的宽度
minListWidthQ下拉列表的最宽度,默认?0像素
loadingTextQ当下拉框加载数据时昄的提CZ息,只有当mode='remote'时才会生?nbsp;
maxHeightQ下拉列表框的最大高度,默认?00像素
minCharsQ下拉列表框自动选择前用户需要输入的最字W数量。mode='remote'默认?Qmode='local'默认?
modeQ下拉列表框的数据读取模式。remotedq程数据Qlocald本地数据
pageSizeQ下拉列表框的分大。该设|只在mode='remote'时生?nbsp;
queryParamQ查询的名字Q默认ؓ'query'Q将被传递到查询字符串中
allQueryQ一个发往服务器用来查询全部信息的查询字符Ԍ默认为空字符?'
selectOnFocusQ当获得焦点时立刻选择一个已存在的列表项。默认ؓfalseQ此只有在editable=true时才会生?nbsp;
storeQ列表框l定的数据源
transformQ将面中已存在的元素{换ؓl合?nbsp;
lazyInitQg时初始化下拉列表Q默认ؓtrue
lazyRenderQg时渲染,默认为false
triggerActionQ设|单击触发按钮时执行的默认操作,有效值包括all和queryQ默认ؓqueryQ如果设|ؓall则会执行allQuery中设|的查询
typeAheadQ设|在输入q程中是否自动选择匚w的剩余部分文本(选择W一个满x件的Q,默认为false
valueQ初始化l合框中的?nbsp;
valueFieldQ组合框的值字D?nbsp;
valueNotFoundTextQg存在时的提示信息
tplQExt模板字符串或模板对象Q可以通过该配|项自定义下拉列表的昄方式
ҎQ?nbsp;
clearValue()Q清I字D当前?nbsp;
doQuery( String query, Boolean forceAll )Q?nbsp;
getValue()Q?nbsp;
getStore()Q?nbsp;
setValue( String value )Q?/p>
allowBlankQ?nbsp;
blankTextQ?/p>
getGroupValue()Q?nbsp;
setValue( value {String/Boolean} )Q?/p>
allowBlankQ是否允怸选择Q默认ؓtrue
blankTextQ?nbsp;
columnsQ显C的列数Q可选值包括:固定值auto、数倹{数l(整数、小敎ͼ
itemsQ对象数l?nbsp;
verticalQ是否垂直方向显C对象,默认为false
boxLabelQ复选框的文字描q?nbsp;
checkedQ复选框是否被选择Q默认ؓfalse
handlerQ当checked值改变时触发的函敎ͼ函数包含两个参数Qcheckbox、checked
inputValueQ?nbsp;
ҎQ?nbsp;
getValue()Q返回复选框的checked状?nbsp;
setValue( Boolean/String checked )Q?/p>
allowDecimalsQ是否允许输入小敎ͼ默认为true
allowNegativeQ是否允许输入负敎ͼ默认为true
baseCharsQ输入的有效数字集合Q默认ؓ'0123456789'
decimalPrecisionQ数字的_ֺQ默认保留小数点??nbsp;
decimalSeparatorQ十q制分隔W,默认?.'
maxValueQ允许输入的最大数?nbsp;
maxTextQ超q最大g后的提示信息
minValueQ允许输入的最数?nbsp;
minTextQ超q最g后的提示信息
nanTextQ输入非有效数g后的提示信息
preventScrollbarsQ是否禁止出现滚动条Q默认ؓfalse
allowBlankQ是否允ؓI,默认为true
blankTextQ空验证p|后显C的提示信息
emptyTextQ在一个空字段中默认显C的信息
growQ字D|否自动展和收羃Q默认ؓfalse
growMinQ收~的最宽?nbsp;
growMaxQ展的最大宽?nbsp;
inputTypeQ字D늱型:默认为text
maskReQ用于过滤不匚w字符输入的正则表辑ּ
maxLengthQ字D允许输入的最大长?nbsp;
maxLengthTextQ最大长度验证失败后昄的提CZ?nbsp;
minLengthQ字D允许输入的最长?nbsp;
minLengthTextQ最长度验证失败后昄的提CZ?nbsp;
regexQ正则表辑ּ
regexTextQ正则表辑ּ验证p|后显C的提示信息
vtypeQ验证类型的名字
alphaQ限制只能输入字?nbsp;
alphanumQ限制只能输入字母和数字
email
url
vtypeTextQ验证失败时的提CZ?nbsp;
validatorQ自定义验证函数
selectOnFocusQ当字段得到焦点时自动选择已存在的文本Q默认ؓfalse
nameQ字D名
valueQ字D늚初始化?nbsp;
disabledQ字D|否不可用Q默认ؓfalse
fieldLabelQ字D|{说?nbsp;
hideLabelQ隐藏字D|{,默认为false
labelSeparatorQ字D|{与字段之间的分隔符Q默认ؓ':'
labelStyleQ字D|{样?nbsp;
inputTypeQ默认ؓtext
invalidClassQ默认ؓx-form-invalid
invalidTextQ字D非法文本提C?nbsp;
msgTargetQ错误信息显C的位置Q默认ؓqtip
qtipQ显CZ个Q动的提示信息
titleQ显CZ个浏览器的Q动提CZ?nbsp;
underQ在字段下方昄一个提CZ?nbsp;
sideQ在字段双昄一个提CZ?nbsp;
readOnlyQ字D|否只读,默认为false
validateOnBlurQ字D在失去焦点时被验证Q默认ؓtrue
ҎQ?nbsp;
clearInvalid()Q?nbsp;
getRawValue()
setRawValue( Mixed value )
getValue()
setValue( Mixed value )
isDirty()Q字D值在装蝲后是否被修改q?nbsp;
isValid( Boolean preventMark )Q当前字D值是否合?nbsp;
markInvalid( [String msg] )
validate()
reset()
itemsQ一个元素或元素数组
buttonsQ一个按钮配|对象的数组Q按钮将被添加到表单脚?nbsp;
buttonAlignQ按钮的寚w方式Q可选值有left、center、rightQ默认ؓcenter
labelWidthQ表单标{宽度
labelAlignQ表单标{寚w方式Q可选值有left、top、rightQ默认ؓleft
labelSeparatorQ字D|{与字段之间的分隔符Q默认ؓ':'
minButtonWidthQ按钮的最宽度,默认?5
ҎQ?nbsp;
getForm() : Ext.form.BasicForm
load( Object options )
startMonitoring()
stopMonitoring()
baseParamsQ传递到h中的参数
methodQ表单的提交方式Q有效值包括GET、POST
urlQ表单默认的提交路径
fileUploadQ表单是否进行文件上?nbsp;
timeoutQ表单动作的时旉Q默认ؓ30U?nbsp;
trackResetOnLoadQ是否在表单初次创徏时清楚数?nbsp;
ҎQ?nbsp;
doAction( String/Object actionName, [Object options] )Q执行一个预订的动作Q可用选项包括Q?nbsp;
urlQ动作提交的路径
methodQ表单的提交方式Q有效值包括GET、POST
paramsQ传递到h中的参数
headersQ?nbsp;
successQ执行成功后回调的函敎ͼ包括两个参数Qform和action
failureQ执行失败后回调的函敎ͼ包括两个参数Qform和action
clientValidationQ是否客L验证
clearInvalid()Q清除表单中所有的无效验证信息
findField( String id )Q查找表单字D?nbsp;
getValues( [Boolean asString] )Q?nbsp;
isDirty()Q表单数据是否被更改q?nbsp;
isValid()Q客L验证是否成功
load( Object options )Q执行表单读取动?nbsp;
loadRecord( Record record )Q从一个数据记录中d数据到表单中
markInvalid( Array/Object errors )Q成批设|表单字Dؓ验证无效
reset()Q重|表?nbsp;
setValues( Array/Object values )Q成批设|表单字D?nbsp;
submit( Object options )Q执行表单提交动?nbsp;
updateRecord( Record record )Q持久化表单数据到记录集?/p>
Ext.form.Action
successQ执行成功后回调的函敎ͼ包括两个参数Qform和action
failureQ执行失败后回调的函敎ͼ包括两个参数Qform和action
methodQ表单的提交方式Q有效值包括GET、POST
paramsQ传递到h中的参数
urlQ动作提交的路径
waitMsgQ动作执行时昄的等待信?nbsp;
属性:
Action.CLIENT_INVALIDQ客L验证错误
Action.CONNECT_FAILUREQ通信错误
Action.LOAD_FAILUREQ加载数据时Q没有包含data属性的字段被返?nbsp;
Action.SERVER_INVALIDQ服务端验证错误
failureTypeQ错误类?nbsp;
resultQ包含布类型的success属性和其他属性,如{success: true, msg: 'ok'}
typeQ动作类型,可选值有submit和load
Ext.form.Action.SubmitQ返回的信息中要包含一个布类型的success属性和一个可选的errors属?nbsp;
Ext.form.Action.LoadQ返回的信息中要包含一个布类型的success属性和一个data属?/p>
Ext.grid.EditorGridPanel
clicksToEditQ设|点d元格q入~辑模式的点L敎ͼ默认?
autoEncodeQ是否自动编?解码HTML内容Q默认ؓfalse
selModelQ默认ؓExt.grid.CellSelectionModel
主要ҎQ?nbsp;
startEditing( Number rowIndex, Number colIndex )Q开始编辑指定单元格
stopEditing( [Boolean cancel] )Q结束编辑操?/p>
Ext.grid.GroupinView
enableGroupingMenuQ是否在表头菜单中进行分l控Ӟ默认为true storeQ表格的数据?nbsp;
columnsQ表格列模式的配|数l,可自动创建ColumnModel列模?nbsp;
autoExpandColumnQ自动充满表格未用空间的列,参数为列idQ该id不能?
stripeRowsQ表格是否隔行换Ԍ默认为false
cm、colModelQ表格的列模式,渲染表格时必设|该配置?nbsp;
sm、selModelQ表格的选择模式Q默认ؓExt.grid.RowSelectionModel
enableHdMenuQ是否显C头的上下文菜单,默认为true
enableColumnHideQ是否允讔R过标题中的上下文菜单隐藏列Q默认ؓtrue
loadMaskQ是否在加蝲数据时显C遮|效果,默认为false
viewQ表D图,默认为Ext.grid.GridView
viewConfigQ表D囄配置对象
autoExpandMaxQ自动扩充列的最大宽度,默认?000
autoExpandMinQ自动扩充列的最宽度,默认?0
columnLinesQ是否显C列分割U,默认为false
disableSelectionQ是否禁止行选择Q默认ؓfalse
enableColumnMoveQ是否允许拖攑ֈQ默认ؓtrue
enableColumnResizeQ是否允许改变列宽,默认为true
hideHeadersQ是否隐藏表_默认为false
maxHeightQ最大高?nbsp;
minColumnWidthQ最列宽,默认?5
trackMouseOverQ是否高亮显C鼠标所在的行,默认为true
主要ҎQ?nbsp;
getColumnModel()Q取得列模式
getSelectionModel()Q取得选择模式
getStore()Q取得数据集
getView()Q取得视囑֯?nbsp;
reconfigure( Ext.data.Store store, Ext.grid.ColumnModel colModel )Q用一个新的数据集和列模式重新配置表格lg
2、Ext.grid.Column
主要配置:
idQ列id
headerQ表头文?nbsp;
dataIndexQ设|列与数据集中数据记录的对应关系Qgؓ数据记录中的字段名称。如果没有设|该则使用列烦引与数据记录中字D늚索引q行对应
widthQ列?nbsp;
alignQ列数据的对齐方?nbsp;
hiddenQ是否隐藏列Q默认ؓfalse
fixedQ是否固定列宽,默认为false
menuDisabledQ是否禁用列的上下文菜单Q默认ؓfalse
resizableQ是否允许改变列宽,默认为true
sortableQ是否允许排序,默认为true
rendererQ设|列的自定义单元格渲染函?nbsp;
传入函数的参数有Q?nbsp;
valueQ数据的原始?nbsp;
metadataQ元数据对象Q用于设|单元格的样式和属性,该对象包含的属性有Q?nbsp;
cssQ应用到单元格TD元素上的样式名称
attrQ一个HTML属性定义字W串Q例?style="color:blue"'
recordQ当前数据记录对?nbsp;
rowIndexQ单元格的行索引
colIndexQ单元格的列索引
storeQ数据集对象
xtypeQ列渲染器类型,默认为gridcolumnQ其它可选值有booleancolumn、numbercolumn、datecolumn、templatecolumn{?nbsp;
editableQ是否可~辑Q默认ؓtrue
editorQ编辑器
groupNameQ?nbsp;
emptyGroupTextQ?nbsp;
groupableQ?nbsp;
3、Ext.grid.ColumnModel
主要配置:
columnsQ字D|l?nbsp;
defaultSortableQ是否进行默认排序,默认为false
defaultWidthQ默认宽?nbsp;
主要ҎQ?nbsp;
findColumnIndex( String col )Q根据给定的dataIndex查找列烦?nbsp;
getColumnById( String id )Q取得指定id对应的列
getColumnCount( Boolean visibleOnly )Q取得列L
getColumnHeader( Number col )Q取得列的表?nbsp;
getColumnId( Number index )Q取得列id
getDataIndex( Number col )Q取得列对应的数据字D名
getIndexById( String id )Q取得列索引
getTotalWidth( Boolean includeHidden )
isCellEditable( Number colIndex, Number rowIndex )
isFixed()
isHidden( Number colIndex )
setColumnHeader( Number col, String header )
setColumnWidth( Number col, Number width, Boolean suppressEvent )
setDataIndex( Number col, String dataIndex )
setEditable( Number col, Boolean editable )
setEditor( Number col, Object editor )
setHidden( Number colIndex, Boolean hidden )
setRenderer( Number col, Function fn )
4、Ext.grid.AbstractSelectionModel
主要ҎQ?nbsp;
lock()Q锁定选择区域
unlock()Q解锁选择区域
isLocked()Q当前选择区域是否被锁?nbsp;
5、Ext.grid.CellSelectionModel
主要ҎQ?nbsp;
clearSelections( Boolean preventNotify )Q清除选择区域
getSelectedCell()Q取得当前选择的单元格Q返回一数组Q其格式Q[rowIndex, colIndex]
hasSelection()Q当前是否有选择区域
select( Number rowIndex, Number colIndex, [Boolean preventViewNotify], [Boolean preventFocus], [Ext.data.Record r] )Q选择指定单元?nbsp;
6、Ext.grid.RowSelectionModel
主要配置:
singleSelectQ是否单选模式,默认为falseQ即可以选择多条数据
主要ҎQ?nbsp;
clearSelections( [Boolean fast] )Q清除所有选择区域
deselectRange( Number startRow, Number endRow )Q取消范围内的行选择
deselectRow( Number row, [Boolean preventViewNotify] )Q取消指定行的选择状?nbsp;
each( Function fn, [Object scope] )Q遍历所有选择行,q调用指定函数。当前被选行传入该函数?nbsp;
getCount()Q得到选择的总行?nbsp;
getSelected()Q得到第一个被选记?nbsp;
getSelections()Q得到所有被选记录的数组
hasNext()Q判断当前被选行之后是否q有记录可以选择
hasPrevious()Q判断当前被选行之前是否q有记录可以选择
hasSelection()Q是否已选择了数?nbsp;
isIdSelected( String id )Q判断指定id的记录是否被选择
isSelected( Number/Record index )Q判断指定记录或记录索引的数据是否被选择
selectAll()Q选择所有行
selectFirstRow()Q选择W一?nbsp;
selectLastRow( [Boolean keepExisting] )Q选择最后行
keepExistingQ是否保持已有的选择
selectNext( [Boolean keepExisting] )Q选择当前选择行的下一?nbsp;
selectPrevious( [Boolean keepExisting] )Q选择当前选择行的上一?nbsp;
selectRange( Number startRow, Number endRow, [Boolean keepExisting] )Q选择范围内的所有行
selectRecords( Array records, [Boolean keepExisting] )Q选择一l指定记?nbsp;
selectRow( Number row, [Boolean keepExisting], [Boolean preventViewNotify] )Q选择一?nbsp;
rowQ行索引
selectRows( Array rows, [Boolean keepExisting] )Q选择多行
rowsQ行索引数组
7、Ext.grid.CheckboxSelectionModel
主要配置:
singleSelectQ是否单选模式,默认为falseQ即可以选择多条数据
checkOnlyQ是否只能通过点击checkbox列进行选择Q默认ؓfalse
sortableQ是否允许checkbox列排序,默认为false
widthQcheckbox列的宽度Q默认ؓ20
8、Ext.grid.RowNumberer
主要配置:
headerQ行号列表头昄的内?nbsp;
widthQ列宽,默认?3
9、Ext.grid.GridView
主要配置:
enableRowBodyQ是否包含行?nbsp;
sortAscTextQ表格标题菜单中升序的文字描q?nbsp;
sortDescTextQ表格标题菜单中降序的文字描q?nbsp;
columnsTextQ表格标题菜单中列对应的文字描述
autoFillQ是否自动扩展列以充满整个表|默认为false
forceFitQ是否强制调整表格列宽以适用表格的整体宽度,防止出现水^滚动条,默认为false
主要ҎQ?nbsp;
focusCell( Number row, Number col )Q将焦点Ud指定单元?nbsp;
focusRow( Number row )Q将焦点Ud指定?nbsp;
getCell( Number row, Number col )Q取得指定单元格对应的td元素
getHeaderCell( Number index )Q取得指定表头对应的td元素
getRow( Number index )Q取得指定行对应的tr元素
getRowClass( Record record, Number index, Object rowParams, Store store )Q得到附加到表格行上的样式名
recordQ当前行的数据记录对?nbsp;
indexQ当前行的烦?nbsp;
rowParamsQ渲染时传入到行模板中的配置对象Q通过它可以ؓ行体定制样式Q该对象只在enableRowBody为true时才生效Q可能的属性如下:
bodyQ渲染到行体中的HTML代码片段
bodyStyleQ应用到行体tr元素style属性的字符?nbsp;
colsQ应用到行体td元素colspan属性的|默认为d?nbsp;
storeQ表格数据集
refresh( [Boolean headersToo] )Q刷新表格组?nbsp;
scrollToTop()Q滚动表格到端
1、在创徏Ext.TabPanel时deferredRender配置经怼被忽略。该配置的默认值是true。true表示只有在用L一ơ访? 选项卡时Q该选项卡的panel才会被渲染?所以当我们有可能用脚本操作选项卡时Q}记将该配|项讄为false?nbsp;
2、在FormPanel中用TabPanelQ如果在TabPanel中不定义deferredRender的gؓfalseQ那么,当你使用 LoadҎ为Form加蝲数据Q或使用setValue为没有激z过的Panel的控件赋值时Q将会发生错误。原因是Q在默认讄? deferredRender为trueQTabPanelq不会渲染所有Panel上的控gQ只有在该Panel被激zL才渲染控Ӟ所以当你ؓq些? 件设|数据时Q将会找不到q些控gQ会出现错误。因而,在FormPanel中用TabPanelQ一定要在TabPanel中设|? deferredRender的gؓfalseQ强制TabPanel在Layout渲染时同时渲染所有Panel上的控g?/span>
大家可以参考下q个|站http://eoffice.im.fju.edu.tw/phpbb/viewtopic.php?p=28685
create schema fdrkftcode
目的是解册U异?span style="color:red">org.h2.jdbc.JdbcSQLException: Schema "fdrkftcode" not found; ...
5.8删除表中某记?DELETE FROM fdrkftcode.admin WHERE fdrkftcode.admin.id=1
6.下面是我目的applicationContext.xml配置ҎQ大家可以参考下
<?xml version="1.0" encoding="UTF-8"?>hibernate.properties
######################
### Query Language ###
######################
## define query language constants / function names
hibernate.query.substitutions yes 'Y', no 'N'
## select the classic query parser
#hibernate.query.factory_class org.hibernate.hql.classic.ClassicQueryTranslatorFactory
#################
### Platforms ###
#################
## JNDI Datasource
#hibernate.connection.datasource jdbc/test
#hibernate.connection.username db2
#hibernate.connection.password db2
## HypersonicSQL
hibernate.dialect org.hibernate.dialect.HSQLDialect
hibernate.connection.driver_class org.hsqldb.jdbcDriver
hibernate.connection.username sa
hibernate.connection.password
hibernate.connection.url jdbc:hsqldb:./build/db/hsqldb/hibernate
#hibernate.connection.url jdbc:hsqldb:hsql://localhost
#hibernate.connection.url jdbc:hsqldb:test
## H2 (www.h2database.com)
#hibernate.dialect org.hibernate.dialect.H2Dialect
#hibernate.connection.driver_class org.h2.Driver
#hibernate.connection.username sa
#hibernate.connection.password
#hibernate.connection.url jdbc:h2:mem:./build/db/h2/hibernate
#hibernate.connection.url jdbc:h2:testdb/h2test
#hibernate.connection.url jdbc:h2:mem:imdb1
#hibernate.connection.url jdbc:h2:tcp://dbserv:8084/sample;
#hibernate.connection.url jdbc:h2:ssl://secureserv:8085/sample;
#hibernate.connection.url jdbc:h2:ssl://secureserv/testdb;cipher=AES
## MySQL
#hibernate.dialect org.hibernate.dialect.MySQLDialect
#hibernate.dialect org.hibernate.dialect.MySQLInnoDBDialect
#hibernate.dialect org.hibernate.dialect.MySQLMyISAMDialect
#hibernate.connection.driver_class com.mysql.jdbc.Driver
#hibernate.connection.url jdbc:mysql:///test
#hibernate.connection.username gavin
#hibernate.connection.password
## Oracle
#hibernate.dialect org.hibernate.dialect.OracleDialect
#hibernate.dialect org.hibernate.dialect.Oracle9Dialect
#hibernate.connection.driver_class oracle.jdbc.driver.OracleDriver
#hibernate.connection.username ora
#hibernate.connection.password ora
#hibernate.connection.url jdbc:oracle:thin:@localhost:1521:orcl
#hibernate.connection.url jdbc:oracle:thin:@localhost:1522:XE
## PostgreSQL
#hibernate.dialect org.hibernate.dialect.PostgreSQLDialect
#hibernate.connection.driver_class org.postgresql.Driver
#hibernate.connection.url jdbc:postgresql:template1
#hibernate.connection.username pg
#hibernate.connection.password
## DB2
#hibernate.dialect org.hibernate.dialect.DB2Dialect
#hibernate.connection.driver_class com.ibm.db2.jcc.DB2Driver
#hibernate.connection.driver_class COM.ibm.db2.jdbc.app.DB2Driver
#hibernate.connection.url jdbc:db2://localhost:50000/somename
#hibernate.connection.url jdbc:db2:somename
#hibernate.connection.username db2
#hibernate.connection.password db2
## TimesTen
#hibernate.dialect org.hibernate.dialect.TimesTenDialect
#hibernate.connection.driver_class com.timesten.jdbc.TimesTenDriver
#hibernate.connection.url jdbc:timesten:direct:test
#hibernate.connection.username
#hibernate.connection.password
## DB2/400
#hibernate.dialect org.hibernate.dialect.DB2400Dialect
#hibernate.connection.username user
#hibernate.connection.password password
## Native driver
#hibernate.connection.driver_class COM.ibm.db2.jdbc.app.DB2Driver
#hibernate.connection.url jdbc:db2://systemname
## Toolbox driver
#hibernate.connection.driver_class com.ibm.as400.access.AS400JDBCDriver
#hibernate.connection.url jdbc:as400://systemname
## Derby (not supported!)
#hibernate.dialect org.hibernate.dialect.DerbyDialect
#hibernate.connection.driver_class org.apache.derby.jdbc.EmbeddedDriver
#hibernate.connection.username
#hibernate.connection.password
#hibernate.connection.url jdbc:derby:build/db/derby/hibernate;create=true
## Sybase
#hibernate.dialect org.hibernate.dialect.SybaseDialect
#hibernate.connection.driver_class com.sybase.jdbc2.jdbc.SybDriver
#hibernate.connection.username sa
#hibernate.connection.password sasasa
#hibernate.connection.url jdbc:sybase:Tds:co3061835-a:5000/tempdb
## Mckoi SQL
#hibernate.dialect org.hibernate.dialect.MckoiDialect
#hibernate.connection.driver_class com.mckoi.JDBCDriver
#hibernate.connection.url jdbc:mckoi:///
#hibernate.connection.url jdbc:mckoi:local://C:/mckoi1.0.3/db.conf
#hibernate.connection.username admin
#hibernate.connection.password nimda
## SAP DB
#hibernate.dialect org.hibernate.dialect.SAPDBDialect
#hibernate.connection.driver_class com.sap.dbtech.jdbc.DriverSapDB
#hibernate.connection.url jdbc:sapdb://localhost/TST
#hibernate.connection.username TEST
#hibernate.connection.password TEST
#hibernate.query.substitutions yes 'Y', no 'N'
## MS SQL Server
#hibernate.dialect org.hibernate.dialect.SQLServerDialect
#hibernate.connection.username sa
#hibernate.connection.password sa
## JSQL Driver
#hibernate.connection.driver_class com.jnetdirect.jsql.JSQLDriver
#hibernate.connection.url jdbc:JSQLConnect://1E1/test
## JTURBO Driver
#hibernate.connection.driver_class com.newatlanta.jturbo.driver.Driver
#hibernate.connection.url jdbc:JTurbo://1E1:1433/test
## WebLogic Driver
#hibernate.connection.driver_class weblogic.jdbc.mssqlserver4.Driver
#hibernate.connection.url jdbc:weblogic:mssqlserver4:1E1:1433
## Microsoft Driver (not recommended!)
#hibernate.connection.driver_class com.microsoft.jdbc.sqlserver.SQLServerDriver
#hibernate.connection.url jdbc:microsoft:sqlserver://1E1;DatabaseName=test;SelectMethod=cursor
## The New Microsoft Driver
#hibernate.connection.driver_class com.microsoft.sqlserver.jdbc.SQLServerDriver
#hibernate.connection.url jdbc:sqlserver://localhost
## jTDS (since version 0.9)
#hibernate.connection.driver_class net.sourceforge.jtds.jdbc.Driver
#hibernate.connection.url jdbc:jtds:sqlserver://1E1/test
## Interbase
#hibernate.dialect org.hibernate.dialect.InterbaseDialect
#hibernate.connection.username sysdba
#hibernate.connection.password masterkey
## DO NOT specify hibernate.connection.sqlDialect
## InterClient
#hibernate.connection.driver_class interbase.interclient.Driver
#hibernate.connection.url jdbc:interbase://localhost:3060/C:/firebird/test.gdb
## Pure Java
#hibernate.connection.driver_class org.firebirdsql.jdbc.FBDriver
#hibernate.connection.url jdbc:firebirdsql:localhost/3050:/firebird/test.gdb
## Pointbase
#hibernate.dialect org.hibernate.dialect.PointbaseDialect
#hibernate.connection.driver_class com.pointbase.jdbc.jdbcUniversalDriver
#hibernate.connection.url jdbc:pointbase:embedded:sample
#hibernate.connection.username PBPUBLIC
#hibernate.connection.password PBPUBLIC
## Ingres
## older versions (before Ingress 2006)
#hibernate.dialect org.hibernate.dialect.IngresDialect
#hibernate.connection.driver_class ca.edbc.jdbc.EdbcDriver
#hibernate.connection.url jdbc:edbc://localhost:II7/database
#hibernate.connection.username user
#hibernate.connection.password password
## Ingres 2006 or later
#hibernate.dialect org.hibernate.dialect.IngresDialect
#hibernate.connection.driver_class com.ingres.jdbc.IngresDriver
#hibernate.connection.url jdbc:ingres://localhost:II7/database;CURSOR=READONLY;auto=multi
#hibernate.connection.username user
#hibernate.connection.password password
## Mimer SQL
#hibernate.dialect org.hibernate.dialect.MimerSQLDialect
#hibernate.connection.driver_class com.mimer.jdbc.Driver
#hibernate.connection.url jdbc:mimer:multi1
#hibernate.connection.username hibernate
#hibernate.connection.password hibernate
## InterSystems Cache
#hibernate.dialect org.hibernate.dialect.Cache71Dialect
#hibernate.connection.driver_class com.intersys.jdbc.CacheDriver
#hibernate.connection.username _SYSTEM
#hibernate.connection.password SYS
#hibernate.connection.url jdbc:Cache://127.0.0.1:1972/HIBERNATE
#################################
### Hibernate Connection Pool ###
#################################
hibernate.connection.pool_size 1
###########################
### C3P0 Connection Pool###
###########################
#hibernate.c3p0.max_size 2
#hibernate.c3p0.min_size 2
#hibernate.c3p0.timeout 5000
#hibernate.c3p0.max_statements 100
#hibernate.c3p0.idle_test_period 3000
#hibernate.c3p0.acquire_increment 2
#hibernate.c3p0.validate false
##############################
### Proxool Connection Pool###
##############################
## Properties for external configuration of Proxool
hibernate.proxool.pool_alias pool1
## Only need one of the following
#hibernate.proxool.existing_pool true
#hibernate.proxool.xml proxool.xml
#hibernate.proxool.properties proxool.properties
#################################
### Plugin ConnectionProvider ###
#################################
## use a custom ConnectionProvider (if not set, Hibernate will choose a built-in ConnectionProvider using hueristics)
#hibernate.connection.provider_class org.hibernate.connection.DriverManagerConnectionProvider
#hibernate.connection.provider_class org.hibernate.connection.DatasourceConnectionProvider
#hibernate.connection.provider_class org.hibernate.connection.C3P0ConnectionProvider
#hibernate.connection.provider_class org.hibernate.connection.ProxoolConnectionProvider
#######################
### Transaction API ###
#######################
## Enable automatic flush during the JTA beforeCompletion() callback
## (This setting is relevant with or without the Transaction API)
#hibernate.transaction.flush_before_completion
## Enable automatic session close at the end of transaction
## (This setting is relevant with or without the Transaction API)
#hibernate.transaction.auto_close_session
## the Transaction API abstracts application code from the underlying JTA or JDBC transactions
#hibernate.transaction.factory_class org.hibernate.transaction.JTATransactionFactory
#hibernate.transaction.factory_class org.hibernate.transaction.JDBCTransactionFactory
## to use JTATransactionFactory, Hibernate must be able to locate the UserTransaction in JNDI
## default is java:comp/UserTransaction
## you do NOT need this setting if you specify hibernate.transaction.manager_lookup_class
#jta.UserTransaction jta/usertransaction
#jta.UserTransaction javax.transaction.UserTransaction
#jta.UserTransaction UserTransaction
## to use the second-level cache with JTA, Hibernate must be able to obtain the JTA TransactionManager
#hibernate.transaction.manager_lookup_class org.hibernate.transaction.JBossTransactionManagerLookup
#hibernate.transaction.manager_lookup_class org.hibernate.transaction.WeblogicTransactionManagerLookup
#hibernate.transaction.manager_lookup_class org.hibernate.transaction.WebSphereTransactionManagerLookup
#hibernate.transaction.manager_lookup_class org.hibernate.transaction.OrionTransactionManagerLookup
#hibernate.transaction.manager_lookup_class org.hibernate.transaction.ResinTransactionManagerLookup
##############################
### Miscellaneous Settings ###
##############################
## print all generated SQL to the console
#hibernate.show_sql true
## format SQL in log and console
hibernate.format_sql true
## add comments to the generated SQL
#hibernate.use_sql_comments true
## generate statistics
#hibernate.generate_statistics true
## auto schema export
#hibernate.hbm2ddl.auto create-drop
#hibernate.hbm2ddl.auto create
#hibernate.hbm2ddl.auto update
#hibernate.hbm2ddl.auto validate
## specify a default schema and catalog for unqualified tablenames
#hibernate.default_schema test
#hibernate.default_catalog test
## enable ordering of SQL UPDATEs by primary key
#hibernate.order_updates true
## set the maximum depth of the outer join fetch tree
hibernate.max_fetch_depth 1
## set the default batch size for batch fetching
#hibernate.default_batch_fetch_size 8
## rollback generated identifier values of deleted entities to default values
#hibernate.use_identifer_rollback true
## enable bytecode reflection optimizer (disabled by default)
#hibernate.bytecode.use_reflection_optimizer true
#####################
### JDBC Settings ###
#####################
## specify a JDBC isolation level
#hibernate.connection.isolation 4
## enable JDBC autocommit (not recommended!)
#hibernate.connection.autocommit true
## set the JDBC fetch size
#hibernate.jdbc.fetch_size 25
## set the maximum JDBC 2 batch size (a nonzero value enables batching)
#hibernate.jdbc.batch_size 5
#hibernate.jdbc.batch_size 0
## enable batch updates even for versioned data
hibernate.jdbc.batch_versioned_data true
## enable use of JDBC 2 scrollable ResultSets (specifying a Dialect will cause Hibernate to use a sensible default)
#hibernate.jdbc.use_scrollable_resultset true
## use streams when writing binary types to / from JDBC
hibernate.jdbc.use_streams_for_binary true
## use JDBC 3 PreparedStatement.getGeneratedKeys() to get the identifier of an inserted row
#hibernate.jdbc.use_get_generated_keys false
## choose a custom JDBC batcher
# hibernate.jdbc.factory_class
## enable JDBC result set column alias caching
## (minor performance enhancement for broken JDBC drivers)
# hibernate.jdbc.wrap_result_sets
## choose a custom SQL exception converter
#hibernate.jdbc.sql_exception_converter
##########################
### Second-level Cache ###
##########################
## optimize chache for minimal "puts" instead of minimal "gets" (good for clustered cache)
#hibernate.cache.use_minimal_puts true
## set a prefix for cache region names
hibernate.cache.region_prefix hibernate.test
## disable the second-level cache
#hibernate.cache.use_second_level_cache false
## enable the query cache
#hibernate.cache.use_query_cache true
## store the second-level cache entries in a more human-friendly format
#hibernate.cache.use_structured_entries true
## choose a cache implementation
#hibernate.cache.provider_class org.hibernate.cache.EhCacheProvider
#hibernate.cache.provider_class org.hibernate.cache.EmptyCacheProvider
hibernate.cache.provider_class org.hibernate.cache.HashtableCacheProvider
#hibernate.cache.provider_class org.hibernate.cache.TreeCacheProvider
#hibernate.cache.provider_class org.hibernate.cache.OSCacheProvider
#hibernate.cache.provider_class org.hibernate.cache.SwarmCacheProvider
## choose a custom query cache implementation
#hibernate.cache.query_cache_factory
############
### JNDI ###
############
## specify a JNDI name for the SessionFactory
#hibernate.session_factory_name hibernate/session_factory
## Hibernate uses JNDI to bind a name to a SessionFactory and to look up the JTA UserTransaction;
## if hibernate.jndi.* are not specified, Hibernate will use the default InitialContext() which
## is the best approach in an application server
#file system
#hibernate.jndi.class com.sun.jndi.fscontext.RefFSContextFactory
#hibernate.jndi.url file:/
#WebSphere
#hibernate.jndi.class com.ibm.websphere.naming.WsnInitialContextFactory
#hibernate.jndi.url iiop://localhost:900/
可以看到览器解压后Q其代码是一LQ?/p>
大家可以看到以上Q这块是在外|用的Q其速度是比较快的。当Ӟ览器解压这个文仉要一Ҏ_不过在本地解压是非常快的Q可以不用管?/p>
三、通过Js~存Q更加可以提高IQT的加载速度Q关于缓存,本文不作讨论?/p>
很显然运行源代码1是能够找到资源文件res.txt。但当我们把整个工程打成jar包以?ResourceJar.jar)Q这个jar包内的目录ؓQ?br /> edu/hxraid/Resource.class
resource/res.txt
而这时jar包中Resource.class字节 码:ldc <String "bin/resource/res.txt"> [20] 无法定位到jar包中的res.txt位置上。就把bin/目录LQldc <String "resource/res.txt"> [20] 仍然无法定位到jar包中res.txt上?/span>
当然不是Q我们可以用c装载器(ClassLoader)来做到这一点:
(1) ClassLoader 是类加蝲器的抽象cR它可以在运行时动态的获取加蝲cȝq行信息?/span> 可以q样_当我们调用ResourceJar.jar中的ResourcecLQJVM加蝲qResourcec,q记录下Resourceq行时信?(包括Resource所在jar包的路径信息)。而ClassLoadercM的方法可以帮助我们动态的获取q些信息:
● public URL getResource(String name)
查找hl定名称的资源。资源是可以通过cM码以与代码基无关的方式访问的一些数?囑փ、声韟뀁文本等)。ƈq回资源的URL对象?br /> ● public InputStream getResourceAsStream(String name);
q回d指定资源的输入流?span style="color: #000080;">q个Ҏ很重要,可以直接获得jar包中文g的内宏V?/span>
(2) ClassLoader是abstract的,不可能实例化对象Q更加不可能通过ClassLoader调用上面两个Ҏ?strong>所以我们真正写代码的时候,是通过ClasscM的getResource()和getResourceAsStream()ҎQ这两个Ҏ会委托ClassLoader中的getResource()和getResourceAsStream()Ҏ 。好了,现在我们重新写一DResource代码,来看看上面那D费解的话是什么意思了Q?/span>
我们这D代码打包成ResourceJar.jar ,q将ResourceJar.jar攑֜其他路径?比如 c:\ResourceJar.jar)。然后另外创Z个java projectq导入ResourceJar.jarQ写一D调用jar包中Resourcecȝ试代码Q?/span>
(3) 我们不能用常规操作文件的Ҏ来读取ResourceJar.jar中的资源文gres.txtQ?strong>但可以通过ClasscȝgetResourceAsStream()Ҏ来获?/span> Q这U方法是如何djar中的资源文g的,q一点对于我们来说是透明的。我们将Resource.java改写成:
格式化代码的快捷?Ctrl + Shift + F
格式化羃q的快捷键是 Ctrl + IQ只能对选中的文本进行羃q?/p>
删除一行的快捷键是 Ctrl + D
当前H口最大化最化切换 Ctrl + M
转到最后进行修改的位置 Ctrl + Q
快速查N中的字W?Ctrl + K(向下) Ctrl + Shift + K(向上)
光标攑ֈ一个括P切换到另一个成对的括号 Ctrl + Shirt + P
在编辑过的位|进行切?Alt + 左右方向?/p>
阅读代码常用的快捷键
F3不解释(一些h喜欢用Ctrl + 鼠标左键Q?/p>
选中Ҏ或者变?Ctrl + Alt + HQ查扑֜哪些地方调用Q快速阅M码和评估代码修改必须要用到的
l承关系 F4Q了解代码的框架
快速查扑և数和变量 Ctrl + OQ输入函数或变量的名字,比在Outline中一个一个找要快很多Q但是要对代码有了解
全工E查?Ctrl + HQ代码巨多的情况下必不可?/p>
׃水^有限Q笔者只用到了这些快捷键
如果想知道其他的快捷?Ctrl + Shift + L
自定义格式化代码
在Preference中打开Java的Format
内徏的模版是不能修改的,点击New...Q随便输入一个名字,新徏一个自q模板Q弹定义EditH口
可以定义的项目非怸富,在右边还可以q行预览Q就对英文不感冒,也可以捉摸出大致的意思。对代码q行格式化的好处是不仅仅是美观,便于阅读Q在 q行团队开发的时候,使用l一的格式,在合q代码的时候可以避免许多的冲突。修改完成的模版是使用Ctrl + Shift + F格式化时的模?/p>
自动去除无用的importQ自动补全@Override和@deprecatedQeclipse的Clean up
在Code Style中,除了Formatq有Clean Up
和Formatq行同样的操作,新徏一个模板,有几个地Ҏ军_有必要改一?/p>
?strong>Code Organizing标签选择Remove trailing whitespaceQ移除尾部的I格Q?/p>
?strong>Organzie imports
选择Organzie imports前效?/p>
import org.model.*;
选择Organzie imports后效?/p>
import org.model.Engine;
切换到Code Style标签
Use blocks in if/while/for/do statements ?strong>if/while/for/do自动d括号Q这个因异Q我军_即只用一行,也应该添加括受?/p>
点击菜单里的Source - Clean upQ可以对代码q行清理Q清理代码最大的好处?#8212;—U除没用的importQ自动添加@Deprecated和@Override
特别是自动添加@OverrideQ可以很清楚的明白那些函数是l承的?/p>
代码提示
用过visual assistx的一定非常系l它的代码提C功能,我是个没有代码提C就无法Coding的hQ点击菜单Windows-PreferenceQ切换到以下H口
扑ֈAuto ActivationQ也是U色Ҏ中的部分Q将Auto activation delay(ms): 修改?50
?strong>Auto activation triggers for Java:修改?.abcdefghigklmnoprstuvwxyzQ这样就能随时提CZ?/p>
最后介l两个工PSearch Everything Ҏ文g名快速查找文ӞClipX剪脓板历史记录?/p>