53 changed files with 1072 additions and 130 deletions
@ -0,0 +1,102 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<w-form |
||||
|
ref="formRef" |
||||
|
:fields="[ |
||||
|
{ |
||||
|
name: 'datasourceName', |
||||
|
label: 'datasourceName', |
||||
|
type: 'select', |
||||
|
options: datasourceOptionsRef, |
||||
|
'onUpdate:modelValue': (value) => { |
||||
|
datasourceNameChanged(value); |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
name: 'schemaName', |
||||
|
label: 'schemaName', |
||||
|
type: 'select', |
||||
|
options: schemaNameOptionsRef, |
||||
|
'onUpdate:modelValue': (value) => { |
||||
|
schemaNameChanged(formRef.getFieldValue('datasourceName'), value); |
||||
|
}, |
||||
|
}, |
||||
|
{ name: 'tableName', label: 'tableName', type: 'select', multiple: true, options: tableNameOptionsRef }, |
||||
|
{ name: 'fetchSize', label: 'fetchSize', type: 'number', defaultValue: 1000 }, |
||||
|
{ name: 'sql', label: 'sql', type: 'code-mirror', colSpan: 4, rows: 5, lang: 'sql' }, |
||||
|
]" |
||||
|
> |
||||
|
</w-form> |
||||
|
<w-grid |
||||
|
ref="gridRef" |
||||
|
:title="$t('queryResult')" |
||||
|
:config-button="false" |
||||
|
selection="multiple" |
||||
|
:checkbox-selection="false" |
||||
|
:data-url="Environment.apiContextPath('/api/system/datasource')" |
||||
|
:query-form-fields="[]" |
||||
|
:toolbar-configure="{ noIcon: false }" |
||||
|
:toolbar-actions="[ |
||||
|
'query', |
||||
|
'refresh', |
||||
|
{ |
||||
|
name: 'export', |
||||
|
label: $t('export'), |
||||
|
icon: '', |
||||
|
click: () => {}, |
||||
|
}, |
||||
|
]" |
||||
|
:columns="[]" |
||||
|
> |
||||
|
</w-grid> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script setup lang="ts"> |
||||
|
import { ref, onMounted, onUpdated } from 'vue'; |
||||
|
import { axios, Environment, EnumTools, Formater, Options, DialogManager, NotifyManager } from 'platform-core'; |
||||
|
|
||||
|
const formRef = ref(); |
||||
|
const datasourceOptionsRef = ref([]); |
||||
|
const schemaNameOptionsRef = ref([]); |
||||
|
const tableNameOptionsRef = ref([]); |
||||
|
|
||||
|
const loadDatasource = () => { |
||||
|
axios.get(Environment.apiContextPath('/api/system/datasource?pageable=false&sortBy=name')).then((response) => { |
||||
|
const data = response?.data.content; |
||||
|
if (data && data.length > 0) { |
||||
|
datasourceOptionsRef.value.splice(0, datasourceOptionsRef.value.length); |
||||
|
for (let item of data) { |
||||
|
datasourceOptionsRef.value.push({ label: item.name, value: item.name }); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
const datasourceNameChanged = (datasourceName: string) => { |
||||
|
axios.get(Environment.apiContextPath('/api/jdbc/metadata/getSchemaNames/' + datasourceName)).then((response) => { |
||||
|
const data = response?.data; |
||||
|
if (data && data.length > 0) { |
||||
|
schemaNameOptionsRef.value.splice(0, schemaNameOptionsRef.value.length); |
||||
|
for (let item of data) { |
||||
|
schemaNameOptionsRef.value.push({ label: item.name, value: item.name }); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
const schemaNameChanged = (datasourceName: string, schemaName: string) => { |
||||
|
axios.get(Environment.apiContextPath('/api/jdbc/metadata/getTables/' + datasourceName + '/' + schemaName)).then((response) => { |
||||
|
const data = response?.data; |
||||
|
if (data && data.length > 0) { |
||||
|
tableNameOptionsRef.value.splice(0, tableNameOptionsRef.value.length); |
||||
|
for (let item of data) { |
||||
|
tableNameOptionsRef.value.push(item.name); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
onMounted(() => { |
||||
|
loadDatasource(); |
||||
|
}); |
||||
|
</script> |
@ -0,0 +1,15 @@ |
|||||
|
/* |
||||
|
* 自动组件扫描插件配置 |
||||
|
* 功能: 该插件配置为框架提供自动扫描组件的包名,配置的包名将会自动被 spring 进行扫描 |
||||
|
* 使用说明: |
||||
|
* includes: 包含自动扫描的包名列表 |
||||
|
* excludes: 排除自动扫描的包名列表 |
||||
|
* 注意: 当一个包名同时存在于 includes 和 excludes 中, excludes 优先, 即该包不会被自动扫描 |
||||
|
*/ |
||||
|
|
||||
|
{ |
||||
|
"includes":[ |
||||
|
"io.sc.platform.jdbc.schemacrawler" |
||||
|
], |
||||
|
"excludes":[] |
||||
|
} |
@ -1,6 +0,0 @@ |
|||||
package io.sc.platform.jdbc; |
|
||||
|
|
||||
public enum DatasourceType { |
|
||||
JNDI, |
|
||||
JDBC; |
|
||||
} |
|
@ -0,0 +1,22 @@ |
|||||
|
package io.sc.platform.jdbc.controller; |
||||
|
|
||||
|
import io.sc.platform.jdbc.plugins.item.JdbcConnectionTemplate; |
||||
|
import io.sc.platform.jdbc.service.JdbcConnectionTemplateService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
@RestController |
||||
|
@RequestMapping("/api/jdbc") |
||||
|
public class JdbcConnectionTemplateWebController { |
||||
|
@Autowired JdbcConnectionTemplateService jdbcConnectionTemplateService; |
||||
|
|
||||
|
@GetMapping("jdbcConnectionTemplate") |
||||
|
public List<JdbcConnectionTemplate> jdbcConnectionTemplate(){ |
||||
|
return jdbcConnectionTemplateService.getTemplates(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,29 @@ |
|||||
|
package io.sc.platform.jdbc.controller; |
||||
|
|
||||
|
import io.sc.platform.jdbc.meta.support.Schema; |
||||
|
import io.sc.platform.jdbc.meta.support.Table; |
||||
|
import io.sc.platform.jdbc.meta.support.TableSummary; |
||||
|
import io.sc.platform.jdbc.service.JdbcMetaDataLoaderService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.PathVariable; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@RestController |
||||
|
@RequestMapping("/api/jdbc/metadata") |
||||
|
public class JdbcMetaDataLoaderWebController { |
||||
|
@Autowired private JdbcMetaDataLoaderService jdbcMetaDataLoaderService; |
||||
|
|
||||
|
@GetMapping("getSchemaNames/{datasourceName}") |
||||
|
public List<Schema> getSchemaNames(@PathVariable(name="datasourceName")String datasourceName) throws Exception { |
||||
|
return jdbcMetaDataLoaderService.getSchemaNames(datasourceName); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("getTables/{datasourceName}/{schemaName}") |
||||
|
public List<Table> getTables(@PathVariable(name="datasourceName")String datasourceName, @PathVariable(name="schemaName")String schemaName) throws Exception { |
||||
|
return jdbcMetaDataLoaderService.getTables(datasourceName,schemaName); |
||||
|
} |
||||
|
} |
@ -0,0 +1,12 @@ |
|||||
|
package io.sc.platform.jdbc.service; |
||||
|
|
||||
|
import io.sc.platform.jdbc.meta.support.Schema; |
||||
|
import io.sc.platform.jdbc.meta.support.Table; |
||||
|
import io.sc.platform.jdbc.meta.support.TableSummary; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
public interface JdbcMetaDataLoaderService { |
||||
|
public List<Schema> getSchemaNames(String datasourceName) throws Exception; |
||||
|
public List<Table> getTables(String datasourceName, String schemaName) throws Exception; |
||||
|
} |
@ -0,0 +1,52 @@ |
|||||
|
package io.sc.platform.jdbc.service.impl; |
||||
|
|
||||
|
import io.sc.platform.jdbc.meta.MetaDataLoader; |
||||
|
import io.sc.platform.jdbc.meta.support.Schema; |
||||
|
import io.sc.platform.jdbc.meta.support.Table; |
||||
|
import io.sc.platform.jdbc.meta.support.TableSummary; |
||||
|
import io.sc.platform.jdbc.service.DatasourceService; |
||||
|
import io.sc.platform.jdbc.service.JdbcMetaDataLoaderService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.util.StringUtils; |
||||
|
|
||||
|
import javax.sql.DataSource; |
||||
|
import java.util.Collections; |
||||
|
import java.util.List; |
||||
|
|
||||
|
@Service |
||||
|
public class JdbcMetaDataLoaderServiceImpl implements JdbcMetaDataLoaderService { |
||||
|
@Autowired DatasourceService datasourceService; |
||||
|
@Autowired MetaDataLoader metaDataLoader; |
||||
|
|
||||
|
@Override |
||||
|
public List<Schema> getSchemaNames(String datasourceName) throws Exception { |
||||
|
DataSource dataSource =null; |
||||
|
if(StringUtils.hasText(datasourceName)) { |
||||
|
dataSource =datasourceService.getDatasource(datasourceName); |
||||
|
}else{ |
||||
|
dataSource =datasourceService.getDefaultDatasource(); |
||||
|
} |
||||
|
if(dataSource!=null){ |
||||
|
return metaDataLoader.getSchemas(dataSource); |
||||
|
} |
||||
|
return Collections.emptyList(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<Table> getTables(String datasourceName, String schemaName) throws Exception { |
||||
|
if(!StringUtils.hasText(schemaName)) { |
||||
|
return Collections.emptyList(); |
||||
|
} |
||||
|
DataSource dataSource =null; |
||||
|
if(StringUtils.hasText(datasourceName)) { |
||||
|
dataSource =datasourceService.getDatasource(datasourceName); |
||||
|
}else{ |
||||
|
dataSource =datasourceService.getDefaultDatasource(); |
||||
|
} |
||||
|
if(dataSource!=null){ |
||||
|
return metaDataLoader.getTables(dataSource,schemaName); |
||||
|
} |
||||
|
return Collections.emptyList(); |
||||
|
} |
||||
|
} |
@ -1,5 +1,6 @@ |
|||||
{ |
{ |
||||
"includes":[ |
"includes":[ |
||||
|
"io.sc.platform.jdbc.controller", |
||||
"io.sc.platform.jdbc.datasource.aspect", |
"io.sc.platform.jdbc.datasource.aspect", |
||||
"io.sc.platform.jdbc.service.impl" |
"io.sc.platform.jdbc.service.impl" |
||||
] |
] |
||||
|
@ -0,0 +1,5 @@ |
|||||
|
{ |
||||
|
"includes":[ |
||||
|
"io/sc/platform/jdbc/i18n/messages" |
||||
|
] |
||||
|
} |
@ -0,0 +1,2 @@ |
|||||
|
io.sc.platform.jdbc.datasource.DatasourceType.JDBC=JDBC |
||||
|
io.sc.platform.jdbc.datasource.DatasourceType.JNDI=JNDI |
@ -0,0 +1,2 @@ |
|||||
|
io.sc.platform.jdbc.datasource.DatasourceType.JDBC=JDBC |
||||
|
io.sc.platform.jdbc.datasource.DatasourceType.JNDI=JNDI |
@ -0,0 +1,2 @@ |
|||||
|
io.sc.platform.jdbc.datasource.DatasourceType.JDBC=JDBC |
||||
|
io.sc.platform.jdbc.datasource.DatasourceType.JNDI=JNDI |
@ -0,0 +1,172 @@ |
|||||
|
<template> |
||||
|
<w-dialog |
||||
|
ref="dialogRef" |
||||
|
:title="$t('system.datasource.grid.toolbar.connectionProperties')" |
||||
|
width="900px" |
||||
|
height="600px" |
||||
|
:can-maximize="false" |
||||
|
:buttons="[ |
||||
|
{ |
||||
|
label: $t('submit'), |
||||
|
noCaps: true, |
||||
|
click: () => { |
||||
|
axios.post(Environment.apiContextPath('/api/system/datasource/connectionProperties/' + id), formRef.getData()).then((response) => { |
||||
|
close(); |
||||
|
NotifyManager.success(); |
||||
|
}); |
||||
|
}, |
||||
|
}, |
||||
|
]" |
||||
|
> |
||||
|
<w-form |
||||
|
ref="formRef" |
||||
|
:cols-num="2" |
||||
|
:fields="[ |
||||
|
{ |
||||
|
name: 'name', |
||||
|
label: 'name', |
||||
|
hidden: true, |
||||
|
}, |
||||
|
{ |
||||
|
name: 'autoCommit', |
||||
|
label: $t('system.datasource.hikari.autoCommit'), |
||||
|
type: 'select', |
||||
|
options: ['', 'true', 'false'], |
||||
|
}, |
||||
|
{ |
||||
|
name: 'connectionTimeout', |
||||
|
label: $t('system.datasource.hikari.connectionTimeout'), |
||||
|
type: 'text', |
||||
|
}, |
||||
|
{ |
||||
|
name: 'idleTimeout', |
||||
|
label: $t('system.datasource.hikari.idleTimeout'), |
||||
|
type: 'text', |
||||
|
}, |
||||
|
{ |
||||
|
name: 'maxLifetime', |
||||
|
label: $t('system.datasource.hikari.maxLifetime'), |
||||
|
type: 'text', |
||||
|
}, |
||||
|
{ |
||||
|
name: 'connectionTestQuery', |
||||
|
label: $t('system.datasource.hikari.connectionTestQuery'), |
||||
|
type: 'text', |
||||
|
}, |
||||
|
{ |
||||
|
name: 'minimumIdle', |
||||
|
label: $t('system.datasource.hikari.minimumIdle'), |
||||
|
type: 'text', |
||||
|
}, |
||||
|
{ |
||||
|
name: 'maximumPoolSize', |
||||
|
label: $t('system.datasource.hikari.maximumPoolSize'), |
||||
|
type: 'text', |
||||
|
}, |
||||
|
{ |
||||
|
name: 'metricRegistry', |
||||
|
label: $t('system.datasource.hikari.metricRegistry'), |
||||
|
type: 'text', |
||||
|
}, |
||||
|
{ |
||||
|
name: 'healthCheckRegistry', |
||||
|
label: $t('system.datasource.hikari.healthCheckRegistry'), |
||||
|
type: 'text', |
||||
|
}, |
||||
|
{ |
||||
|
name: 'poolName', |
||||
|
label: $t('system.datasource.hikari.poolName'), |
||||
|
type: 'text', |
||||
|
}, |
||||
|
{ |
||||
|
name: 'initializationFailTimeout', |
||||
|
label: $t('system.datasource.hikari.initializationFailTimeout'), |
||||
|
type: 'text', |
||||
|
}, |
||||
|
{ |
||||
|
name: 'isolateInternalQueries', |
||||
|
label: $t('system.datasource.hikari.isolateInternalQueries'), |
||||
|
type: 'select', |
||||
|
options: ['', 'true', 'false'], |
||||
|
}, |
||||
|
{ |
||||
|
name: 'allowPoolSuspension', |
||||
|
label: $t('system.datasource.hikari.allowPoolSuspension'), |
||||
|
type: 'select', |
||||
|
options: ['', 'true', 'false'], |
||||
|
}, |
||||
|
{ |
||||
|
name: 'readOnly', |
||||
|
label: $t('system.datasource.hikari.readOnly'), |
||||
|
type: 'select', |
||||
|
options: ['', 'true', 'false'], |
||||
|
}, |
||||
|
{ |
||||
|
name: 'registerMbeans', |
||||
|
label: $t('system.datasource.hikari.registerMbeans'), |
||||
|
type: 'select', |
||||
|
options: ['', 'true', 'false'], |
||||
|
}, |
||||
|
{ |
||||
|
name: 'catalog', |
||||
|
label: $t('system.datasource.hikari.catalog'), |
||||
|
type: 'text', |
||||
|
}, |
||||
|
{ |
||||
|
name: 'connectionInitSql', |
||||
|
label: $t('system.datasource.hikari.connectionInitSql'), |
||||
|
type: 'text', |
||||
|
}, |
||||
|
{ |
||||
|
name: 'transactionIsolation', |
||||
|
label: $t('system.datasource.hikari.connectionInitSql'), |
||||
|
type: 'select', |
||||
|
options: ['', 'TRANSACTION_READ_COMMITTED', 'TRANSACTION_REPEATABLE_READ', ''], |
||||
|
}, |
||||
|
{ |
||||
|
name: 'validationTimeout', |
||||
|
label: $t('system.datasource.hikari.validationTimeout'), |
||||
|
type: 'text', |
||||
|
}, |
||||
|
{ |
||||
|
name: 'leakDetectionThreshold', |
||||
|
label: $t('system.datasource.hikari.leakDetectionThreshold'), |
||||
|
type: 'text', |
||||
|
}, |
||||
|
{ |
||||
|
name: 'schema', |
||||
|
label: $t('system.datasource.hikari.schema'), |
||||
|
type: 'text', |
||||
|
}, |
||||
|
]" |
||||
|
class="p-2" |
||||
|
></w-form> |
||||
|
</w-dialog> |
||||
|
</template> |
||||
|
<script setup lang="ts"> |
||||
|
import { nextTick, ref } from 'vue'; |
||||
|
import { axios, Environment, NotifyManager } from 'platform-core'; |
||||
|
|
||||
|
const dialogRef = ref(); |
||||
|
const formRef = ref(); |
||||
|
let id = ''; |
||||
|
|
||||
|
const open = (datasourceId: string) => { |
||||
|
id = datasourceId; |
||||
|
dialogRef.value.show(); |
||||
|
nextTick(() => { |
||||
|
axios.get(Environment.apiContextPath('/api/system/datasource/connectionProperties/' + datasourceId)).then((response) => { |
||||
|
formRef.value.setData(response.data); |
||||
|
}); |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
const close = () => { |
||||
|
dialogRef.value.hide(); |
||||
|
}; |
||||
|
|
||||
|
defineExpose({ |
||||
|
open, |
||||
|
close, |
||||
|
}); |
||||
|
</script> |
@ -0,0 +1,168 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<w-grid |
||||
|
ref="gridRef" |
||||
|
:title="$t('system.i18n.grid.title')" |
||||
|
:config-button="true" |
||||
|
selection="multiple" |
||||
|
:checkbox-selection="true" |
||||
|
:data-url="Environment.apiContextPath('/api/system/datasource')" |
||||
|
:query-form-fields="[ |
||||
|
{ name: 'name', label: $t('name'), type: 'text', clearable: true }, |
||||
|
{ name: 'type', label: $t('type'), type: 'select', options: Options.enum(DatasourceTypeEnum), queryOperator: 'equals', clearable: true }, |
||||
|
]" |
||||
|
:toolbar-configure="{ noIcon: false }" |
||||
|
:toolbar-actions="[ |
||||
|
'query', |
||||
|
'refresh', |
||||
|
'separator', |
||||
|
'add', |
||||
|
'clone', |
||||
|
'edit', |
||||
|
'remove', |
||||
|
'separator', |
||||
|
{ |
||||
|
name: 'connectionProperties', |
||||
|
label: $t('system.datasource.grid.toolbar.connectionProperties'), |
||||
|
icon: 'bi-card-list', |
||||
|
enableIf: (selecteds) => { |
||||
|
return selecteds && selecteds.length > 0 && selecteds[0].type === 'JDBC'; |
||||
|
}, |
||||
|
click: (selecteds) => { |
||||
|
if (selecteds && selecteds.length > 0) { |
||||
|
dialogRef.open(selecteds[0].id); |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
'separator', |
||||
|
'view', |
||||
|
'separator', |
||||
|
'export', |
||||
|
]" |
||||
|
:columns="[ |
||||
|
{ width: 150, name: 'name', label: $t('name') }, |
||||
|
{ width: 80, name: 'type', label: $t('type') }, |
||||
|
{ width: 100, name: 'jndiName', label: $t('system.datasource.grid.entity.jndiName'), sortable: false }, |
||||
|
{ width: 100, name: 'databaseType', label: $t('system.datasource.grid.entity.databaseType'), sortable: false }, |
||||
|
{ width: 200, name: 'jdbcDriver', label: $t('system.datasource.grid.entity.jdbcDriver'), sortable: false }, |
||||
|
{ width: 200, name: 'jdbcUrl', label: $t('system.datasource.grid.entity.jdbcUrl'), sortable: false }, |
||||
|
{ width: 100, name: 'username', label: $t('userName'), sortable: false }, |
||||
|
{ width: 100, name: 'lastModifier', label: $t('lastModifier') }, |
||||
|
{ width: 110, name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.dateOnly() }, |
||||
|
]" |
||||
|
:editor="{ |
||||
|
dialog: { |
||||
|
width: '800px', |
||||
|
height: '500px', |
||||
|
}, |
||||
|
form: { |
||||
|
colsNum: 1, |
||||
|
fields: [ |
||||
|
{ name: 'name', label: $t('name'), type: 'text', required: true }, |
||||
|
{ name: 'type', label: $t('type'), type: 'select', required: true, options: Options.enum(DatasourceTypeEnum), defaultValue: 'JDBC' }, |
||||
|
{ |
||||
|
name: 'jndiName', |
||||
|
label: $t('system.datasource.grid.entity.jndiName'), |
||||
|
type: 'text', |
||||
|
required: true, |
||||
|
showIf: (form) => { |
||||
|
return form.getFieldValue('type') === 'JNDI'; |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
name: 'databaseType', |
||||
|
label: $t('system.datasource.grid.entity.databaseType'), |
||||
|
type: 'select', |
||||
|
options: databaseTypeRef, |
||||
|
dense: true, |
||||
|
required: true, |
||||
|
showIf: (form) => { |
||||
|
return form.getFieldValue('type') === 'JDBC'; |
||||
|
}, |
||||
|
'onUpdate:modelValue': (value) => { |
||||
|
gridRef.getEditorForm().setFieldValue('jdbcDriver', databaseTypeMapRef[value].driver); |
||||
|
gridRef.getEditorForm().setFieldValue('jdbcUrl', databaseTypeMapRef[value].urlSample); |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
name: 'jdbcDriver', |
||||
|
label: $t('system.datasource.grid.entity.jdbcDriver'), |
||||
|
type: 'text', |
||||
|
required: true, |
||||
|
showIf: (form) => { |
||||
|
return form.getFieldValue('type') === 'JDBC'; |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
name: 'jdbcUrl', |
||||
|
label: $t('system.datasource.grid.entity.jdbcUrl'), |
||||
|
type: 'text', |
||||
|
required: true, |
||||
|
showIf: (form) => { |
||||
|
return form.getFieldValue('type') === 'JDBC'; |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
name: 'username', |
||||
|
label: $t('userName'), |
||||
|
type: 'text', |
||||
|
showIf: (form) => { |
||||
|
return form.getFieldValue('type') === 'JDBC'; |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
name: 'password', |
||||
|
label: $t('password'), |
||||
|
type: 'text', |
||||
|
showIf: (form) => { |
||||
|
return form.getFieldValue('type') === 'JDBC'; |
||||
|
}, |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
}" |
||||
|
:viewer="{ |
||||
|
panel: { |
||||
|
columnNum: 1, |
||||
|
fields: [ |
||||
|
{ name: 'name', label: $t('name') }, |
||||
|
{ name: 'type', label: $t('type') }, |
||||
|
{ name: 'jndiName', label: $t('system.datasource.grid.entity.jndiName') }, |
||||
|
{ name: 'databaseType', label: $t('system.datasource.grid.entity.databaseType') }, |
||||
|
{ name: 'jdbcDriver', label: $t('system.datasource.grid.entity.jdbcDriver') }, |
||||
|
{ name: 'jdbcUrl', label: $t('system.datasource.grid.entity.jdbcUrl') }, |
||||
|
{ name: 'username', label: $t('userName') }, |
||||
|
{ name: 'dataComeFrom', label: $t('dataComeFrom') }, |
||||
|
{ name: 'creator', label: $t('creator') }, |
||||
|
{ name: 'createDate', label: $t('createDate') }, |
||||
|
{ name: 'lastModifier', label: $t('lastModifier') }, |
||||
|
{ name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.none() }, |
||||
|
{ name: 'corporationCode', label: $t('corporationCode') }, |
||||
|
], |
||||
|
}, |
||||
|
}" |
||||
|
@row-click="(evt, row, index) => {}" |
||||
|
></w-grid> |
||||
|
<ConnectionPropertiesDialog ref="dialogRef"></ConnectionPropertiesDialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script setup lang="ts"> |
||||
|
import { ref } from 'vue'; |
||||
|
import { axios, Environment, EnumTools, Formater, Options } from 'platform-core'; |
||||
|
import ConnectionPropertiesDialog from './ConnectionPropertiesDialog.vue'; |
||||
|
|
||||
|
const gridRef = ref(); |
||||
|
const dialogRef = ref(); |
||||
|
const DatasourceTypeEnum = await EnumTools.fetch('io.sc.platform.jdbc.datasource.DatasourceType'); |
||||
|
const databaseTypeRef = ref([]); |
||||
|
const databaseTypeMapRef = ref({}); |
||||
|
axios.get(Environment.apiContextPath('/api/jdbc/jdbcConnectionTemplate')).then((response) => { |
||||
|
const templates = response.data; |
||||
|
databaseTypeRef.value.splice(0, databaseTypeRef.value.length); |
||||
|
databaseTypeMapRef.value = {}; |
||||
|
for (let template of templates) { |
||||
|
databaseTypeRef.value.push(template.type); |
||||
|
databaseTypeMapRef.value[template.type] = template; |
||||
|
} |
||||
|
}); |
||||
|
</script> |
@ -0,0 +1,92 @@ |
|||||
|
DatabaseSchemaInstallerItem.name=Configure Database Connection |
||||
|
|
||||
|
org.wsp.framework.datasource.installer.label.select_ds_type=Datasource Type |
||||
|
org.wsp.framework.datasource.installer.label.jndi_name=JNDI Name |
||||
|
org.wsp.framework.datasource.installer.label.database_type=Database Type |
||||
|
org.wsp.framework.datasource.installer.label.jdbc_url=JDBC URL |
||||
|
org.wsp.framework.datasource.installer.label.database_username=Database Connection User Name |
||||
|
org.wsp.framework.datasource.installer.label.database_password=Database Connection Password |
||||
|
org.wsp.framework.datasource.installer.label.database_options=Database Intall Options |
||||
|
org.wsp.framework.datasource.installer.label.database_options.create=Auto Create Database Objects |
||||
|
org.wsp.framework.datasource.installer.label.database_options.skip=Skip Create Database Objects |
||||
|
org.wsp.framework.datasource.installer.label.database_options.dropAllFirst=Drop All Database Objects First And Auto Create New Database Objects |
||||
|
|
||||
|
org.wsp.framework.datasource.installer.action.configurationProperties=Connection Properties |
||||
|
org.wsp.framework.datasource.installer.button.connection_test=Test Connection |
||||
|
|
||||
|
org.wsp.framework.datasource.installer.tip.required=This item required |
||||
|
org.wsp.framework.datasource.installer.tip.jdbc_url_sample=Format |
||||
|
org.wsp.framework.datasource.installer.tip.connection_test_success=Connection Test Success |
||||
|
org.wsp.framework.datasource.installer.tip.connection_test_failed=Connection Test Failed, and error message: |
||||
|
org.wsp.framework.datasource.installer.tip.request_failed=Request Failed, and error message: |
||||
|
org.wsp.framework.datasource.installer.tip.databaseObjectAlreadyExists=Database Object Already Exists, Can NOT Create the Objects in install, You Can Select Other Option in "Database Intall Options", and try again |
||||
|
|
||||
|
org.wsp.framework.datasource.window.title.add=Add Datasource Configuration |
||||
|
org.wsp.framework.datasource.window.title.modify=Modify Datasource Configuration |
||||
|
|
||||
|
org.wsp.framework.datasource.list =Datasource List |
||||
|
org.wsp.framework.datasource.name=Name |
||||
|
org.wsp.framework.datasource.datasourceType=Datasource Type |
||||
|
org.wsp.framework.datasource.databaseType=Database Type |
||||
|
org.wsp.framework.datasource.description=description |
||||
|
org.wsp.framework.datasource.jdbcDriver=JDBC Driver |
||||
|
org.wsp.framework.datasource.jdbcUrl=Connection URL |
||||
|
org.wsp.framework.datasource.hibernateDialect=Hibernate Dialect |
||||
|
org.wsp.framework.datasource.username=User Name |
||||
|
org.wsp.framework.datasource.password=Password |
||||
|
org.wsp.framework.datasource.jndiName=JNDI Name |
||||
|
|
||||
|
# druid ds properties |
||||
|
org.wsp.framework.datasource.defaultAutoCommit=\u662F\u5426\u81EA\u52A8\u63D0\u4EA4 |
||||
|
org.wsp.framework.datasource.defaultReadOnly=\u662F\u5426\u53EA\u8BFB |
||||
|
org.wsp.framework.datasource.defaultTransactionIsolation=\u4E8B\u52A1\u9694\u79BB\u7B49\u7EA7 |
||||
|
org.wsp.framework.datasource.defaultCatalog=\u9ED8\u8BA4 Catalog |
||||
|
org.wsp.framework.datasource.init=\u662F\u5426\u5728\u521B\u5EFA\u6570\u636E\u6E90\u65F6\u8FDB\u884C\u521D\u59CB\u5316 |
||||
|
org.wsp.framework.datasource.initialSize=\u521D\u59CB\u5316\u65F6\u5EFA\u7ACB\u7269\u7406\u8FDE\u63A5\u7684\u4E2A\u6570,\u521D\u59CB\u5316\u53D1\u751F\u5728\u663E\u793A\u8C03\u7528 init() \u65B9\u6CD5\uFF0C\u6216\u8005\u7B2C\u4E00\u6B21 getConnection() \u65F6<br/><br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:0 |
||||
|
org.wsp.framework.datasource.maxActive=\u6700\u5927\u8FDE\u63A5\u6C60\u6570\u91CF<br/><br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:8 |
||||
|
org.wsp.framework.datasource.minIdle=\u6700\u5C0F\u8FDE\u63A5\u6C60\u6570\u91CF<br/><br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:0 |
||||
|
org.wsp.framework.datasource.maxWait=\u83B7\u53D6\u8FDE\u63A5\u65F6\u6700\u5927\u7B49\u5F85\u65F6\u95F4\uFF0C\u5355\u4F4D\u6BEB\u79D2\u3002\u914D\u7F6E\u4E86maxWait\u4E4B\u540E\uFF0C\u7F3A\u7701\u542F\u7528\u516C\u5E73\u9501\uFF0C\u5E76\u53D1\u6548\u7387\u4F1A\u6709\u6240\u4E0B\u964D\uFF0C\u5982\u679C\u9700\u8981\u53EF\u4EE5\u901A\u8FC7\u914D\u7F6E useUnfairLock \u5C5E\u6027\u4E3A true \u4F7F\u7528\u975E\u516C\u5E73\u9501 |
||||
|
org.wsp.framework.datasource.poolPreparedStatements=\u662F\u5426\u7F13\u5B58 preparedStatement\uFF0C\u4E5F\u5C31\u662F PSCache\u3002PSCache \u5BF9\u652F\u6301\u6E38\u6807\u7684\u6570\u636E\u5E93\u6027\u80FD\u63D0\u5347\u5DE8\u5927\uFF0C\u6BD4\u5982\u8BF4 oracle\u3002\u5728 mysql \u4E0B\u5EFA\u8BAE\u5173\u95ED<br/><br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:false |
||||
|
org.wsp.framework.datasource.maxPoolPreparedStatementPerConnectionSize=\u8981\u542F\u7528 PSCache\uFF0C\u5FC5\u987B\u914D\u7F6E\u5927\u4E8E0\uFF0C\u5F53\u5927\u4E8E0\u65F6\uFF0CpoolPreparedStatements \u81EA\u52A8\u89E6\u53D1\u4FEE\u6539\u4E3Atrue\u3002\u5728 Druid \u4E2D\uFF0C\u4E0D\u4F1A\u5B58\u5728 Oracle \u4E0B PSCache \u5360\u7528\u5185\u5B58\u8FC7\u591A\u7684\u95EE\u9898\uFF0C\u53EF\u4EE5\u628A\u8FD9\u4E2A\u6570\u503C\u914D\u7F6E\u5927\u4E00\u4E9B\uFF0C\u6BD4\u5982\u8BF4100<br/><br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:-1 |
||||
|
org.wsp.framework.datasource.validationQuery=\u7528\u6765\u68C0\u6D4B\u8FDE\u63A5\u662F\u5426\u6709\u6548\u7684 sql\uFF0C\u8981\u6C42\u662F\u4E00\u4E2A\u67E5\u8BE2\u8BED\u53E5\uFF0C\u5E38\u7528select 1\u3002\u5982\u679C validationQuery \u4E3Anull\uFF0CtestOnBorrow\u3001testOnReturn\u3001testWhileIdle \u90FD\u4E0D\u4F1A\u5176\u4F5C\u7528 |
||||
|
org.wsp.framework.datasource.validationQueryTimeout=\u5355\u4F4D\uFF1A\u79D2\uFF0C\u68C0\u6D4B\u8FDE\u63A5\u662F\u5426\u6709\u6548\u7684\u8D85\u65F6\u65F6\u95F4\u3002\u5E95\u5C42\u8C03\u7528 jdbc Statement \u5BF9\u8C61\u7684 void setQueryTimeout(int seconds) \u65B9\u6CD5 |
||||
|
org.wsp.framework.datasource.testOnBorrow=\u662F\u5426\u5728\u7533\u8BF7\u8FDE\u63A5\u65F6\u6267\u884CvalidationQuery\u68C0\u6D4B\u8FDE\u63A5\u662F\u5426\u6709\u6548\uFF0C\u505A\u4E86\u8FD9\u4E2A\u914D\u7F6E\u4F1A\u964D\u4F4E\u6027\u80FD<br/><br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:true |
||||
|
org.wsp.framework.datasource.testOnReturn=\u662F\u5426\u5728\u5F52\u8FD8\u8FDE\u63A5\u65F6\u6267\u884CvalidationQuery\u68C0\u6D4B\u8FDE\u63A5\u662F\u5426\u6709\u6548\uFF0C\u505A\u4E86\u8FD9\u4E2A\u914D\u7F6E\u4F1A\u964D\u4F4E\u6027\u80FD<br/><br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:false |
||||
|
org.wsp.framework.datasource.testWhileIdle=\u662F\u5426\u5728\u7A7A\u95F2\u65F6\u6267\u884CvalidationQuery\u68C0\u6D4B\u8FDE\u63A5\u662F\u5426\u6709\u6548\uFF0C\u5EFA\u8BAE\u914D\u7F6E\u4E3A true\uFF0C\u4E0D\u5F71\u54CD\u6027\u80FD\uFF0C\u5E76\u4E14\u4FDD\u8BC1\u5B89\u5168\u6027\u3002\u7533\u8BF7\u8FDE\u63A5\u7684\u65F6\u5019\u68C0\u6D4B\uFF0C\u5982\u679C\u7A7A\u95F2\u65F6\u95F4\u5927\u4E8E timeBetweenEvictionRunsMillis\uFF0C\u6267\u884C validationQuery \u68C0\u6D4B\u8FDE\u63A5\u662F\u5426\u6709\u6548<br/><br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:false |
||||
|
org.wsp.framework.datasource.timeBetweenEvictionRunsMillis=\u6709\u4E24\u4E2A\u542B\u4E49:<br/>1) Destroy \u7EBF\u7A0B\u4F1A\u68C0\u6D4B\u8FDE\u63A5\u7684\u95F4\u9694\u65F6\u95F4\uFF0C\u5982\u679C\u8FDE\u63A5\u7A7A\u95F2\u65F6\u95F4\u5927\u4E8E\u7B49\u4E8E minEvictableIdleTimeMillis \u5219\u5173\u95ED\u7269\u7406\u8FDE\u63A5<br/>2) testWhileIdle \u7684\u5224\u65AD\u4F9D\u636E\uFF0C\u8BE6\u7EC6\u770B testWhileIdle \u5C5E\u6027\u7684\u8BF4\u660E<br/><br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:1\u5206\u949F |
||||
|
org.wsp.framework.datasource.minEvictableIdleTimeMillis=\u8FDE\u63A5\u4FDD\u6301\u7A7A\u95F2\u800C\u4E0D\u88AB\u9A71\u9010\u7684\u6700\u957F\u65F6\u95F4 |
||||
|
org.wsp.framework.datasource.connectionInitSqls=\u7269\u7406\u8FDE\u63A5\u521D\u59CB\u5316\u7684\u65F6\u5019\u6267\u884C\u7684sql |
||||
|
org.wsp.framework.datasource.exceptionSorter=\u5F53\u6570\u636E\u5E93\u629B\u51FA\u4E00\u4E9B\u4E0D\u53EF\u6062\u590D\u7684\u5F02\u5E38\u65F6\uFF0C\u629B\u5F03\u8FDE\u63A5<br/><br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:\u6839\u636E dbType \u81EA\u52A8\u8BC6\u522B |
||||
|
org.wsp.framework.datasource.useGlobalDataSourceStat=\u662F\u5426\u4F7F\u7528\u5168\u5C40\u6570\u636E\u6E90\u7EDF\u8BA1 |
||||
|
org.wsp.framework.datasource.connectionProperties=\u8FDE\u63A5\u5176\u4ED6\u914D\u7F6E\u5C5E\u6027 |
||||
|
org.wsp.framework.datasource.filters=\u5B57\u7B26\u4E32\uFF0C\u901A\u8FC7\u522B\u540D\u7684\u65B9\u5F0F\u914D\u7F6E\u6269\u5C55\u63D2\u4EF6\uFF0C\u5E38\u7528\u7684\u63D2\u4EF6\u6709<br/>\u76D1\u63A7\u7EDF\u8BA1\u7528\u7684filter:stat<br/>\u65E5\u5FD7\u7528\u7684filter:log4j<br/>\u9632\u5FA1sql\u6CE8\u5165\u7684filter:wall |
||||
|
|
||||
|
# hikari ds properties |
||||
|
org.wsp.framework.datasource.hikari.autoCommit=Auto Commit<br/><br/>default value:true |
||||
|
org.wsp.framework.datasource.hikari.connectionTimeout=Connection Timeout (millisecond)<br/><br/>minimal value:250<br/>default value:30000(30 seconds) |
||||
|
org.wsp.framework.datasource.hikari.idleTimeout=Idle Timeout (millisecond)<br/><br/>minimal value:10000(10 seconds)<br/>default value:600000(10 minutes) |
||||
|
org.wsp.framework.datasource.hikari.maxLifetime=Max Life Time(millisecond)<br/><br/>default value:1800000(30 minutes) |
||||
|
org.wsp.framework.datasource.hikari.connectionTestQuery=Connection Test Query Sql(JDBC4 Not needed) |
||||
|
org.wsp.framework.datasource.hikari.minimumIdle=Minimum Idle<br/><br/>default value: equals maximumPoolSize |
||||
|
org.wsp.framework.datasource.hikari.maximumPoolSize=Maximum Pool Size<br/><br/>default value:10 |
||||
|
org.wsp.framework.datasource.hikari.metricRegistry=Metric Registry |
||||
|
org.wsp.framework.datasource.hikari.healthCheckRegistry=Health Check Registry |
||||
|
org.wsp.framework.datasource.hikari.poolName=Pool Name |
||||
|
|
||||
|
org.wsp.framework.datasource.hikari.initializationFailTimeout=Initialization Fail Timeout |
||||
|
org.wsp.framework.datasource.hikari.isolateInternalQueries=Internal Query Isolate<br/><br/>default value:false |
||||
|
org.wsp.framework.datasource.hikari.allowPoolSuspension=Allow Pool Suspension<br/><br/>default value:false |
||||
|
org.wsp.framework.datasource.hikari.readOnly=Read Only<br/><br/>default value:false |
||||
|
org.wsp.framework.datasource.hikari.registerMbeans=Register Mbeans<br/><br/>default value:false |
||||
|
org.wsp.framework.datasource.hikari.catalog=Catalog |
||||
|
org.wsp.framework.datasource.hikari.connectionInitSql=Connection init Sql |
||||
|
org.wsp.framework.datasource.hikari.driverClassName=JDBC Driver Class Name |
||||
|
org.wsp.framework.datasource.hikari.transactionIsolation=Transaction Isolation |
||||
|
org.wsp.framework.datasource.hikari.validationTimeout=Validation Timeout(millisecond)<br/><br/>minimal value:250<br/>default value:5000(5 seconds) |
||||
|
org.wsp.framework.datasource.hikari.leakDetectionThreshold=Leak Detection Threshold<br/><br/>minimal value:2000<br/>default value:0(not check) |
||||
|
org.wsp.framework.datasource.hikari.dataSource=DataSource |
||||
|
org.wsp.framework.datasource.hikari.schema=Schema |
||||
|
org.wsp.framework.datasource.hikari.threadFactory=Thread Factory |
||||
|
org.wsp.framework.datasource.hikari.scheduledExecutor=Scheduled Executor |
||||
|
|
||||
|
org.wsp.framework.datasource.preference=DataSource Configuration |
@ -0,0 +1,90 @@ |
|||||
|
DatabaseSchemaInstallerItem.name=\u914D\u7F6E\u6570\u636E\u5E93\u8FDE\u63A5 |
||||
|
|
||||
|
org.wsp.framework.datasource.installer.label.select_ds_type=\u6570\u636E\u5E93\u8FDE\u63A5\u7C7B\u578B |
||||
|
org.wsp.framework.datasource.installer.label.jndi_name=JNDI \u540D\u79F0 |
||||
|
org.wsp.framework.datasource.installer.label.database_type=\u6570\u636E\u5E93\u7C7B\u578B |
||||
|
org.wsp.framework.datasource.installer.label.jdbc_url=JDBC URL |
||||
|
org.wsp.framework.datasource.installer.label.database_username=\u6570\u636E\u5E93\u7528\u6237\u540D |
||||
|
org.wsp.framework.datasource.installer.label.database_password=\u6570\u636E\u5E93\u7528\u6237\u5BC6\u7801 |
||||
|
org.wsp.framework.datasource.installer.label.database_options=\u6570\u636E\u5E93\u5B89\u88C5\u9009\u9879 |
||||
|
org.wsp.framework.datasource.installer.label.database_options.create=\u81EA\u52A8\u521B\u5EFA\u6570\u636E\u5E93\u5BF9\u8C61\u5E76\u4E14\u521D\u59CB\u5316\u5FC5\u8981\u6570\u636E |
||||
|
org.wsp.framework.datasource.installer.label.database_options.skip=\u4FDD\u7559\u73B0\u6709\u6570\u636E\u5E93\u4E2D\u7684\u6240\u6709\u5BF9\u8C61\uFF0C\u5373\u8DF3\u8FC7\u6570\u636E\u5E93\u5BF9\u8C61\u521B\u5EFA |
||||
|
org.wsp.framework.datasource.installer.label.database_options.dropAllFirst=\u5B89\u88C5\u524D\u9996\u5148\u5220\u9664\u73B0\u6709\u6570\u636E\u5E93\u4E2D\u6240\u6709\u5BF9\u8C61,\u6CE8\u610F:\u8BE5\u64CD\u4F5C\u4E0D\u53EF\u9006\uFF0C\u5728\u786E\u8BA4\u6267\u884C\u5B89\u88C5\u524D\u8BF7\u505A\u597D\u6570\u636E\u5907\u4EFD! |
||||
|
|
||||
|
org.wsp.framework.datasource.installer.action.configurationProperties=\u8FDE\u63A5\u5C5E\u6027 |
||||
|
org.wsp.framework.datasource.installer.button.connection_test=\u6D4B\u8BD5\u6570\u636E\u5E93\u8FDE\u63A5 |
||||
|
|
||||
|
org.wsp.framework.datasource.installer.tip.required=\u6B64\u9879\u4E3A\u5FC5\u8F93\u9879 |
||||
|
org.wsp.framework.datasource.installer.tip.jdbc_url_sample=\u683C\u5F0F |
||||
|
org.wsp.framework.datasource.installer.tip.connection_test_success=\u6570\u636E\u5E93\u8FDE\u63A5\u6D4B\u8BD5\u6210\u529F |
||||
|
org.wsp.framework.datasource.installer.tip.connection_test_failed=\u6570\u636E\u5E93\u8FDE\u63A5\u6D4B\u8BD5\u5931\u8D25,\u4FE1\u606F\u5982\u4E0B: |
||||
|
org.wsp.framework.datasource.installer.tip.request_failed=\u8BF7\u6C42\u5931\u8D25,\u4FE1\u606F\u5982\u4E0B: |
||||
|
org.wsp.framework.datasource.installer.tip.databaseObjectAlreadyExists=\u6570\u636E\u5E93\u5BF9\u8C61\u5DF2\u7ECF\u5B58\u5728,\u5728\u5B89\u88C5\u65F6\u4E0D\u80FD\u521B\u5EFA\u65B0\u7684\u5BF9\u8C61,\u8BF7\u6839\u636E\u4F60\u7684\u9700\u8981\u5728 "\u6570\u636E\u5E93\u5B89\u88C5\u9009\u9879" \u4E2D\u9009\u62E9\u5176\u4ED6\u9009\u9879,\u7136\u540E\u91CD\u8BD5 |
||||
|
|
||||
|
org.wsp.framework.datasource.window.title.add=\u6DFB\u52A0\u6570\u636E\u6E90\u914D\u7F6E |
||||
|
org.wsp.framework.datasource.window.title.modify=\u4FEE\u6539\u6570\u636E\u6E90\u914D\u7F6E |
||||
|
|
||||
|
org.wsp.framework.datasource.list=\u6570\u636E\u6E90\u5217\u8868 |
||||
|
org.wsp.framework.datasource.name=\u540D\u79F0 |
||||
|
org.wsp.framework.datasource.datasourceType=\u6570\u636E\u6E90\u7C7B\u578B |
||||
|
org.wsp.framework.datasource.databaseType=\u6570\u636E\u5E93\u7C7B\u578B |
||||
|
org.wsp.framework.datasource.description=\u63CF\u8FF0 |
||||
|
org.wsp.framework.datasource.jdbcDriver=JDBC \u9A71\u52A8\u7C7B\u540D\u79F0 |
||||
|
org.wsp.framework.datasource.jdbcUrl=\u6570\u636E\u5E93\u8FDE\u63A5 URL |
||||
|
org.wsp.framework.datasource.hibernateDialect=Hibernate \u65B9\u8A00\u540D\u79F0 |
||||
|
org.wsp.framework.datasource.username=\u8FDE\u63A5\u7528\u6237\u540D |
||||
|
org.wsp.framework.datasource.password=\u8FDE\u63A5\u5BC6\u7801 |
||||
|
org.wsp.framework.datasource.jndiName=JNDI \u540D\u79F0 |
||||
|
|
||||
|
# druid ds properties |
||||
|
org.wsp.framework.datasource.defaultAutoCommit=\u662F\u5426\u81EA\u52A8\u63D0\u4EA4 |
||||
|
org.wsp.framework.datasource.defaultReadOnly=\u662F\u5426\u53EA\u8BFB |
||||
|
org.wsp.framework.datasource.defaultTransactionIsolation=\u4E8B\u52A1\u9694\u79BB\u7B49\u7EA7 |
||||
|
org.wsp.framework.datasource.defaultCatalog=\u9ED8\u8BA4 Catalog |
||||
|
org.wsp.framework.datasource.init=\u662F\u5426\u5728\u521B\u5EFA\u6570\u636E\u6E90\u65F6\u8FDB\u884C\u521D\u59CB\u5316 |
||||
|
org.wsp.framework.datasource.initialSize=\u521D\u59CB\u5316\u65F6\u5EFA\u7ACB\u7269\u7406\u8FDE\u63A5\u7684\u4E2A\u6570,\u521D\u59CB\u5316\u53D1\u751F\u5728\u663E\u793A\u8C03\u7528 init() \u65B9\u6CD5\uFF0C\u6216\u8005\u7B2C\u4E00\u6B21 getConnection() \u65F6<br/><br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:0 |
||||
|
org.wsp.framework.datasource.maxActive=\u6700\u5927\u8FDE\u63A5\u6C60\u6570\u91CF<br/><br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:8 |
||||
|
org.wsp.framework.datasource.minIdle=\u6700\u5C0F\u8FDE\u63A5\u6C60\u6570\u91CF<br/><br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:0 |
||||
|
org.wsp.framework.datasource.maxWait=\u83B7\u53D6\u8FDE\u63A5\u65F6\u6700\u5927\u7B49\u5F85\u65F6\u95F4\uFF0C\u5355\u4F4D\u6BEB\u79D2\u3002\u914D\u7F6E\u4E86maxWait\u4E4B\u540E\uFF0C\u7F3A\u7701\u542F\u7528\u516C\u5E73\u9501\uFF0C\u5E76\u53D1\u6548\u7387\u4F1A\u6709\u6240\u4E0B\u964D\uFF0C\u5982\u679C\u9700\u8981\u53EF\u4EE5\u901A\u8FC7\u914D\u7F6E useUnfairLock \u5C5E\u6027\u4E3A true \u4F7F\u7528\u975E\u516C\u5E73\u9501 |
||||
|
org.wsp.framework.datasource.poolPreparedStatements=\u662F\u5426\u7F13\u5B58 preparedStatement\uFF0C\u4E5F\u5C31\u662F PSCache\u3002PSCache \u5BF9\u652F\u6301\u6E38\u6807\u7684\u6570\u636E\u5E93\u6027\u80FD\u63D0\u5347\u5DE8\u5927\uFF0C\u6BD4\u5982\u8BF4 oracle\u3002\u5728 mysql \u4E0B\u5EFA\u8BAE\u5173\u95ED<br/><br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:false |
||||
|
org.wsp.framework.datasource.maxPoolPreparedStatementPerConnectionSize=\u8981\u542F\u7528 PSCache\uFF0C\u5FC5\u987B\u914D\u7F6E\u5927\u4E8E0\uFF0C\u5F53\u5927\u4E8E0\u65F6\uFF0CpoolPreparedStatements \u81EA\u52A8\u89E6\u53D1\u4FEE\u6539\u4E3Atrue\u3002\u5728 Druid \u4E2D\uFF0C\u4E0D\u4F1A\u5B58\u5728 Oracle \u4E0B PSCache \u5360\u7528\u5185\u5B58\u8FC7\u591A\u7684\u95EE\u9898\uFF0C\u53EF\u4EE5\u628A\u8FD9\u4E2A\u6570\u503C\u914D\u7F6E\u5927\u4E00\u4E9B\uFF0C\u6BD4\u5982\u8BF4100<br/><br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:-1 |
||||
|
org.wsp.framework.datasource.validationQuery=\u7528\u6765\u68C0\u6D4B\u8FDE\u63A5\u662F\u5426\u6709\u6548\u7684 sql\uFF0C\u8981\u6C42\u662F\u4E00\u4E2A\u67E5\u8BE2\u8BED\u53E5\uFF0C\u5E38\u7528select 1\u3002\u5982\u679C validationQuery \u4E3Anull\uFF0CtestOnBorrow\u3001testOnReturn\u3001testWhileIdle \u90FD\u4E0D\u4F1A\u5176\u4F5C\u7528 |
||||
|
org.wsp.framework.datasource.validationQueryTimeout=\u5355\u4F4D\uFF1A\u79D2\uFF0C\u68C0\u6D4B\u8FDE\u63A5\u662F\u5426\u6709\u6548\u7684\u8D85\u65F6\u65F6\u95F4\u3002\u5E95\u5C42\u8C03\u7528 jdbc Statement \u5BF9\u8C61\u7684 void setQueryTimeout(int seconds) \u65B9\u6CD5 |
||||
|
org.wsp.framework.datasource.testOnBorrow=\u662F\u5426\u5728\u7533\u8BF7\u8FDE\u63A5\u65F6\u6267\u884CvalidationQuery\u68C0\u6D4B\u8FDE\u63A5\u662F\u5426\u6709\u6548\uFF0C\u505A\u4E86\u8FD9\u4E2A\u914D\u7F6E\u4F1A\u964D\u4F4E\u6027\u80FD<br/><br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:true |
||||
|
org.wsp.framework.datasource.testOnReturn=\u662F\u5426\u5728\u5F52\u8FD8\u8FDE\u63A5\u65F6\u6267\u884CvalidationQuery\u68C0\u6D4B\u8FDE\u63A5\u662F\u5426\u6709\u6548\uFF0C\u505A\u4E86\u8FD9\u4E2A\u914D\u7F6E\u4F1A\u964D\u4F4E\u6027\u80FD<br/><br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:false |
||||
|
org.wsp.framework.datasource.testWhileIdle=\u662F\u5426\u5728\u7A7A\u95F2\u65F6\u6267\u884CvalidationQuery\u68C0\u6D4B\u8FDE\u63A5\u662F\u5426\u6709\u6548\uFF0C\u5EFA\u8BAE\u914D\u7F6E\u4E3A true\uFF0C\u4E0D\u5F71\u54CD\u6027\u80FD\uFF0C\u5E76\u4E14\u4FDD\u8BC1\u5B89\u5168\u6027\u3002\u7533\u8BF7\u8FDE\u63A5\u7684\u65F6\u5019\u68C0\u6D4B\uFF0C\u5982\u679C\u7A7A\u95F2\u65F6\u95F4\u5927\u4E8E timeBetweenEvictionRunsMillis\uFF0C\u6267\u884C validationQuery \u68C0\u6D4B\u8FDE\u63A5\u662F\u5426\u6709\u6548<br/><br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:false |
||||
|
org.wsp.framework.datasource.timeBetweenEvictionRunsMillis=\u6709\u4E24\u4E2A\u542B\u4E49:<br/>1) Destroy \u7EBF\u7A0B\u4F1A\u68C0\u6D4B\u8FDE\u63A5\u7684\u95F4\u9694\u65F6\u95F4\uFF0C\u5982\u679C\u8FDE\u63A5\u7A7A\u95F2\u65F6\u95F4\u5927\u4E8E\u7B49\u4E8E minEvictableIdleTimeMillis \u5219\u5173\u95ED\u7269\u7406\u8FDE\u63A5<br/>2) testWhileIdle \u7684\u5224\u65AD\u4F9D\u636E\uFF0C\u8BE6\u7EC6\u770B testWhileIdle \u5C5E\u6027\u7684\u8BF4\u660E<br/><br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:1\u5206\u949F |
||||
|
org.wsp.framework.datasource.minEvictableIdleTimeMillis=\u8FDE\u63A5\u4FDD\u6301\u7A7A\u95F2\u800C\u4E0D\u88AB\u9A71\u9010\u7684\u6700\u957F\u65F6\u95F4 |
||||
|
org.wsp.framework.datasource.connectionInitSqls=\u7269\u7406\u8FDE\u63A5\u521D\u59CB\u5316\u7684\u65F6\u5019\u6267\u884C\u7684sql |
||||
|
org.wsp.framework.datasource.exceptionSorter=\u5F53\u6570\u636E\u5E93\u629B\u51FA\u4E00\u4E9B\u4E0D\u53EF\u6062\u590D\u7684\u5F02\u5E38\u65F6\uFF0C\u629B\u5F03\u8FDE\u63A5<br/><br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:\u6839\u636E dbType \u81EA\u52A8\u8BC6\u522B |
||||
|
org.wsp.framework.datasource.useGlobalDataSourceStat=\u662F\u5426\u4F7F\u7528\u5168\u5C40\u6570\u636E\u6E90\u7EDF\u8BA1 |
||||
|
org.wsp.framework.datasource.connectionProperties=\u8FDE\u63A5\u5176\u4ED6\u914D\u7F6E\u5C5E\u6027 |
||||
|
org.wsp.framework.datasource.filters=\u5B57\u7B26\u4E32\uFF0C\u901A\u8FC7\u522B\u540D\u7684\u65B9\u5F0F\u914D\u7F6E\u6269\u5C55\u63D2\u4EF6\uFF0C\u5E38\u7528\u7684\u63D2\u4EF6\u6709<br/>\u76D1\u63A7\u7EDF\u8BA1\u7528\u7684filter:stat<br/>\u65E5\u5FD7\u7528\u7684filter:log4j<br/>\u9632\u5FA1sql\u6CE8\u5165\u7684filter:wall |
||||
|
|
||||
|
# hikari ds properties |
||||
|
org.wsp.framework.datasource.hikari.autoCommit=\u662F\u5426\u81EA\u52A8\u63D0\u4EA4<br/><br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:true |
||||
|
org.wsp.framework.datasource.hikari.connectionTimeout=\u8FDE\u63A5\u8D85\u65F6(\u5355\u4F4D:\u6BEB\u79D2)<br/><br/>\u6700\u5C0F\u503C:250<br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:30000(30\u79D2) |
||||
|
org.wsp.framework.datasource.hikari.idleTimeout=\u7A7A\u95F2\u8D85\u65F6(\u6BEB\u79D2)<br/><br/>\u6700\u5C0F\u503C:10000(10\u79D2)<br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:600000(10\u5206\u949F) |
||||
|
org.wsp.framework.datasource.hikari.maxLifetime=\u6700\u5927\u6D3B\u52A8\u65F6\u95F4(\u6BEB\u79D2)<br/><br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:1800000(30\u5206\u949F) |
||||
|
org.wsp.framework.datasource.hikari.connectionTestQuery=\u8FDE\u63A5\u6D4B\u8BD5\u67E5\u8BE2(JDBC4 \u65E0\u9700\u586B\u5199) |
||||
|
org.wsp.framework.datasource.hikari.minimumIdle=\u6700\u5C0F\u7A7A\u95F2<br/><br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:\u540C maximumPoolSize |
||||
|
org.wsp.framework.datasource.hikari.maximumPoolSize=\u6C60\u6700\u5927\u5C3A\u5BF8<br/><br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:10 |
||||
|
org.wsp.framework.datasource.hikari.metricRegistry=\u76D1\u63A7\u6307\u6807\u6CE8\u518C\u5668 |
||||
|
org.wsp.framework.datasource.hikari.healthCheckRegistry=\u5065\u5EB7\u68C0\u67E5\u6CE8\u518C\u5668 |
||||
|
org.wsp.framework.datasource.hikari.poolName=\u8FDE\u63A5\u6C60\u540D\u79F0 |
||||
|
|
||||
|
org.wsp.framework.datasource.hikari.initializationFailTimeout=\u521D\u59CB\u5316\u5931\u8D25\u8D85\u65F6 |
||||
|
org.wsp.framework.datasource.hikari.isolateInternalQueries=\u5185\u90E8\u67E5\u8BE2\u662F\u5426\u8981\u88AB\u9694\u79BB<br/><br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:false |
||||
|
org.wsp.framework.datasource.hikari.allowPoolSuspension=\u662F\u5426\u5141\u8BB8\u6C60\u6682\u505C<br/><br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:false |
||||
|
org.wsp.framework.datasource.hikari.readOnly=\u662F\u5426\u53EA\u8BFB<br/><br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:false |
||||
|
org.wsp.framework.datasource.hikari.registerMbeans=\u662F\u5426\u6CE8\u518C\u4E3A MBean<br/><br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:false |
||||
|
org.wsp.framework.datasource.hikari.catalog=\u76EE\u5F55 |
||||
|
org.wsp.framework.datasource.hikari.connectionInitSql=\u8FDE\u63A5\u521D\u59CB\u5316 sql |
||||
|
org.wsp.framework.datasource.hikari.driverClassName=JDBC \u9A71\u52A8\u7C7B\u540D\u79F0 |
||||
|
org.wsp.framework.datasource.hikari.transactionIsolation=\u4E8B\u52A1\u9694\u79BB\u5EA6 |
||||
|
org.wsp.framework.datasource.hikari.validationTimeout=\u9A8C\u8BC1\u8D85\u65F6<br/><br/>\u6700\u5C0F\u503C:250<br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:5000(5\u79D2) |
||||
|
org.wsp.framework.datasource.hikari.leakDetectionThreshold=\u6CC4\u6F0F\u68C0\u6D4B\u9608\u503C<br/><br/>\u6700\u5C0F\u503C:2000<br/>\u4E0D\u586B\u5199\u91C7\u7528\u9ED8\u8BA4\u503C:0(\u4E0D\u8FDB\u884C\u6CC4\u6F0F\u68C0\u67E5) |
||||
|
org.wsp.framework.datasource.hikari.dataSource=\u6570\u636E\u6E90 |
||||
|
org.wsp.framework.datasource.hikari.schema=\u65B9\u6848 |
||||
|
org.wsp.framework.datasource.hikari.threadFactory=\u7EBF\u7A0B\u5DE5\u5382 |
||||
|
org.wsp.framework.datasource.hikari.scheduledExecutor=\u8BA1\u5212\u4EFB\u52A1\u6267\u884C\u5668 |
Loading…
Reference in new issue