当前位置:首页 > 新闻中心

真人app-JdbcTool 2.0 发布,JDBC 多源操作工具

发布时间: 2021-05-04   来源: 真人app  
本文摘要:真人app,真人手机app,JdbcTool2.0早已公布,此版本升级內容包含:根据1.0除去对spring不必要的依靠、提升编码、修补bug详细介绍借助spring-jdbc的动态性多源数据库操作专用工具特点适用流行关联型数据库查询数据库查询默认设置mysql、Oracle、postgres,可依据本身要求加上jdbcConnection模板动态性载入数据信息池多数据库分页查询集成化duird若有必须可在新项目中加上druid监管网页页面配备使用说明书在classpath下wood.json中以json文件格式配备数据库查询信息内容,也可在系统变量中以参数configFile特定文件夹名称ex:java-jardemo.jar--configFile=wood.jsonjson环境变量实例{//是不是开发者模式操纵控制面板日志打印"isDebugger":true,"dbConfig":{//多数据库配备"datasource":[{"sourceName":"mainDb","type":"mysql","ip":"*.*.*.*","port":3306,"loginName":"*","pwd":"*","endParam":"singlewood?serverTimezone=UTC"}],//jdbc模板为运作中动态性转化成数据库出示模板适用"templateList":[{"type":"mysql","driverClassName":".jdbc.Driver","port":3306,"jdbcTemplate":"jdbc:mysql://{{IP}}:{{PORT}}/{{END_PARAM}}"},{"type":"oracle","driverClassName":".OracleDriver","port":1521,"jdbcTemplate":"jdbc:oracle:thin:{{IP}}:{{PORT}}/{{END_PARAM}}"},{"type":"postgres","driverClassName":"","port":5432,"jdbcTemplate":"jdbc:postgresql://{{IP}}:{{PORT}}/{{END_PARAM}}"}]}}实体类实例TableName"ST_PARM"PrimaryField"PARM_ID"publicclassStParmimplementsSerializable{/***参数序号*/FieldColumn"PARM_ID"privateStringparmId;/***参数归类*/FieldColumn"CATEGORY"privateStringcategory;/***参数名字*/FieldColumn"NAME"privateStringname;/***参数初始值*/FieldColumn"DEFAULT_VALUE"privateStringdefaultValue;/***参数当今值*/FieldColumn"NOW_VALUE"privateStringnowValue;/***参数运作值*/FieldColumn"RUN_VALUE"privateStringrunValue;/***参数极小值*/FieldColumn"MIN_VALUE"privateStringminValue;/***参数最高值*/FieldColumn"MAX_VALUE"privateStringmaxValue;/***参数文件格式*/FieldColumn"FORMAT"privateStringformat;/***备注名称*/FieldColumn"NOTE"privateStringnote;/***应用标示*/FieldColumn"STATE"privateStringstate;/***排列*/FieldColumn"IDX"privateStringidx;/***系统软件序号*/FieldColumn"MIS_ID"privateStringmisId;}应用实例复位数据信息联接//1.应用默认设置主配JdbcDataBasedb=DataSourceFactory.getMianDb;//2.应用配备名配对载入db=DataSourceFactory.getDbBySourceName"mainDb";//3.得出必需参数依靠默认设置模板转化成JdbcDataBasedb=DataSourceFactory.getDbnewDbInfo{{setDbType"mysql";setPort3306;setLogoinName"***";setPwd"***";setIp"***";setEndParam"singlewood";}};//4.得出url不依靠模板JdbcDataBasedb=DataSourceFactory.getDbnewDbInfo{{setConnectStr"jdbc:mysql://***:3306/singlewood";setLogoinName"***";setPwd"***";}};//newDbTemplate{{setUrlTemplate"jdbc:mysql://{{IP}}:{{PORT}}/{{END_PARAM}}";setPort3306;setDriverClassName".jdbc.Driver";setDbType"mysql-t";}};JdbcDataBasedb=DataSourceFactory.getDbnewDbInfo{{setDbType"mysql-t";setPort3306;setLogoinName"***";setPwd"***";setIp"***";setEndParam"singlewood";}};实际应用增加单独实体线相互配合带本专用工具注解的实体类应用db.insertBsDiary.class,newBsDiary{{setDHead"head";....}};关系id单独删掉相互配合带本专用工具注解的实体类应用db.delectbyIdBsDiary.class,"1";关系id好几个删掉相互配合带本专用工具注解的实体类应用db.delectbyIdsBsDiary.class,newArrayList{{add"1";add"2";...}};单一简易种类数据查询db.querySingleTypeResult"selectheadfrombs_diarywhered_diaryId=?",String.class,"42";几行简易种类数据查询db.querySingleTypeList"selectheadfrombs_diary",String.class;单一实体线数据查询相互配合带本专用工具注解的实体类应用db.queryOneRow"select*frombs_diarywhered_diaryId=?",BsDiary.class,"42";几行实体线数据查询相互配合带本专用工具注解的实体类应用db.queryList"select*frombs_diary",BsDiary.class;Map查看db.queryForMap"select*frombs_diarywhered_diaryId=?","42";list查看db.queryListMap"select*frombs_diary";分页查询db.queryPageData"select*frombs_diary",1,10,true;依据id升级BsDiarydiary=db.findRowByIdBsDiary.class,"42";diary.setDHead"update";db.updateByIdBsDiary.class,diary;事务管理JdbcDataBasedb=newJdbcDataBasedbInfo,config;StringtransactionId=db.beginTransaction;try{//增加单独实体线db.insertBsDiary.class,newBsDiary{{setDHead"head";}};thrownewException"eee";//db.commitTransactiontransactionId;}catchExceptione{db.rollbackTransactiontransactionId;}......待升级

真人app

JdbcTool2.0早已公布,此版本升级內容包含:根据1.0除去对spring不必要的依靠、提升编码、修补bug详细介绍借助spring-jdbc的动态性多源数据库操作专用工具特点适用流行关联型数据库查询数据库查询默认设置mysql、Oracle、postgres,可依据本身要求加上jdbcConnection模板动态性载入数据信息池多数据库分页查询集成化duird若有必须可在新项目中加上druid监管网页页面配备使用说明书在classpath下wood.json中以json文件格式配备数据库查询信息内容,也可在系统变量中以参数configFile特定文件夹名称ex:java-jardemo.jar--configFile=wood.jsonjson环境变量实例{//是不是开发者模式操纵控制面板日志打印"isDebugger":true,"dbConfig":{//多数据库配备"datasource":[{"sourceName":"mainDb","type":"mysql","ip":"*.*.*.*","port":3306,"loginName":"*","pwd":"*","endParam":"singlewood?serverTimezone=UTC"}],//jdbc模板为运作中动态性转化成数据库出示模板适用"templateList":[{"type":"mysql","driverClassName":".jdbc.Driver","port":3306,"jdbcTemplate":"jdbc:mysql://{{IP}}:{{PORT}}/{{END_PARAM}}"},{"type":"oracle","driverClassName":".OracleDriver","port":1521,"jdbcTemplate":"jdbc:oracle:thin:{{IP}}:{{PORT}}/{{END_PARAM}}"},{"type":"postgres","driverClassName":"","port":5432,"jdbcTemplate":"jdbc:postgresql://{{IP}}:{{PORT}}/{{END_PARAM}}"}]}}实体类实例TableName"ST_PARM"PrimaryField"PARM_ID"publicclassStParmimplementsSerializable{/***参数序号*/FieldColumn"PARM_ID"privateStringparmId;/***参数归类*/FieldColumn"CATEGORY"privateStringcategory;/***参数名字*/FieldColumn"NAME"privateStringname;/***参数初始值*/FieldColumn"DEFAULT_VALUE"privateStringdefaultValue;/***参数当今值*/FieldColumn"NOW_VALUE"privateStringnowValue;/***参数运作值*/FieldColumn"RUN_VALUE"privateStringrunValue;/***参数极小值*/FieldColumn"MIN_VALUE"privateStringminValue;/***参数最高值*/FieldColumn"MAX_VALUE"privateStringmaxValue;/***参数文件格式*/FieldColumn"FORMAT"privateStringformat;/***备注名称*/FieldColumn"NOTE"privateStringnote;/***应用标示*/FieldColumn"STATE"privateStringstate;/***排列*/FieldColumn"IDX"privateStringidx;/***系统软件序号*/FieldColumn"MIS_ID"privateStringmisId;}应用实例复位数据信息联接//1.应用默认设置主配JdbcDataBasedb=DataSourceFactory.getMianDb

真人手机app

;//2.应用配备名配对载入db=DataSourceFactory.getDbBySourceName"mainDb";//3.得出必需参数依靠默认设置模板转化成JdbcDataBasedb=DataSourceFactory.getDbnewDbInfo{{setDbType"mysql";setPort3306;setLogoinName"***";setPwd"***";setIp"***";setEndParam"singlewood";}};//4.得出url不依靠模板JdbcDataBasedb=DataSourceFactory.getDbnewDbInfo{{setConnectStr"jdbc:mysql://***:3306/singlewood";setLogoinName"***";setPwd"***";}};//newDbTemplate{{setUrlTemplate"jdbc:mysql://{{IP}}:{{PORT}}/{{END_PARAM}}";setPort3306;setDriverClassName".jdbc.Driver";setDbType"mysql-t";}};JdbcDataBasedb=DataSourceFactory.getDbnewDbInfo{{setDbType"mysql-t";setPort3306;setLogoinName"***";setPwd"***";setIp"***";setEndParam"singlewood";}};实际应用增加单独实体线相互配合带本专用工具注解的实体类应用db.insertBsDiary.class,newBsDiary{{setDHead"head";....}};关系id单独删掉相互配合带本专用工具注解的实体类应用db.delectbyIdBsDiary.class,"1";关系id好几个删掉相互配合带本专用工具注解的实体类应用db.delectbyIdsBsDiary.class,newArrayList{{add"1";add"2";...}};单一简易种类数据查询db.querySingleTypeResult"selectheadfrombs_diarywhered_diaryId=?",String.class,"42";几行简易种类数据查询db.querySingleTypeList"selectheadfrombs_diary",String.class;单一实体线数据查询相互配合带本专用工具注解的实体类应用db.queryOneRow"select*frombs_diarywhered_diaryId=?",BsDiary.class,"42";几行实体线数据查询相互配合带本专用工具注解的实体类应用db.queryList"select*frombs_diary",BsDiary.class;Map查看db.queryForMap"select*frombs_diarywhered_diaryId=?","42";list查看db.queryListMap"select*frombs_diary";分页查询db.queryPageData"select*frombs_diary",1,10,true;依据id升级BsDiarydiary=db.findRowByIdBsDiary.class,"42";diary.setDHead"update";db.updateByIdBsDiary.class,diary;事务管理JdbcDataBasedb=newJdbcDataBasedbInfo,config;StringtransactionId=db.beginTransaction;try{//增加单独实体线db.insertBsDiary.class,newBsDiary{{setDHead"head";}};thrownewException"eee";//db.commitTransactiontransactionId;}catchExceptione{db.rollbackTransactiontransactionId;}......待升
本文关键词:真人app,真人手机app

本文来源:真人app-www.flfcministries.com