使用JDBC的CachedRowSet实现将数据源中的数据读取到内存中进行离线操作

JDBC中使用RowSet包装结果集 背景 C#中有了DataSet,可以把底层数据读取到内存中进行离线操作。操作完成再同步到底层数据源。Java中也提供了类似的功能——RowSet。 和ResultSet相比,RowSet默认是可以滚动、可更新、可序列化的结果集合,而且作为Javabean使用。并支持离线操作,降低了数据库的负载。 RowSetProvider负责创建RowSetFactory,而RowSetFactory则提... 阅读详情

以前用.NET的DataSet,使用很方便且强大,发现JDBC也有类似的CachedRowSet 也还不错使用如下:

1、

import javax.sql.rowset.CachedRowSet;
import com.sun.rowset.CachedRowSetImpl;

2、

CachedRowSet crs=new CachedRowSetImpl();

3、

 //返回CachedRowSet结果集合,使用 populate用一个有数据的 CachedRowSet 来填充另一个CachedRowSet。
 public CachedRowSet querySqlToCachedRowset(String sql)throws Exception{
  if (conn != null) {
   try {
    stmt = conn.createStatement();
    rs = stmt.executeQuery(sql);
    crs.populate(rs);
   } catch (Exception e) {
    e.printStackTrace();
   } finally {
    toClose();
   }

  }
  return crs;
 }

 

在网上查资料的得知:

CachedRowSet实现了RowSet是最常用的一种 RowSet。其他三

Java 学习之路 之 Java7的RowSet1.1(五十五) 1,Java 7 新增的 RowSetFactory 与 RowSet 2,离线 RowSet 3,离线 RowSet 的查询分页 阅读详情

相关推荐

sun.jdbc.rowset的jar包

sun.jdbc.rowset的jar包,2000年的老包。不过有些老项目需要。 包括sun.jdbc.rowset.CachedRowSet。

Hierarchical-Localization 环境配置与依赖管理全攻略

本文提供了Hierarchical-Localization(hloc)视觉定位工具箱从零开始的环境配置与依赖管理全攻略。针对Windows、Ubuntu和macOS三大操作系统,详细解析了Python版本选择、PyTorch与CUDA版本匹配、pycolmap版本锁定等核心依赖的安装步骤,并汇总了权重文件格式、NumPy版本、路径配置等常见问题的排查与解决方案,旨在帮助用户高效搭建稳定的hloc开发环境。

weixin_29066781的博客 335

扩增子测序|iCAMP包——基于系统发育零模型分析确定性和随机性在群落构建过程R中实践

iCAMP的核心功能是通过系统发育分箱的零模型分析,量化不同生态过程的相对重要性。,用于评估不同生态过程(同质选择、异质选择、扩散和漂变)对整个群落及各个系统发育分箱(bin)的相对重要性。该方法也成为nature,science系列文章的常客,深受大家喜欢,在文章中运用该方法将为论文增色不少。外环和内环的圆环图显示了每个门(或变形菌门的分类)中不同过程的相对重要性。中央是系统发育树,内环展示了不同过程的相对重要性,表示每个系统发育箱中的DL。示例代码中提供了数据和代码,已经小编测试,可直接运行。

weixin_46814750的博客 6262

前端监控性能指标

文章目录前端监控性能指标性能指标阶段性指标关键性能指标小程序W3C Level 1兼容性常规用法注意事项1、计算HTML文档请求使用 Nav Timing2、计算静态资源使用 getEntriesByType('resource') 代替 getEntries()3、secureConnectionStart 问题4、跨域资源设置响应头 Timing-Allow-Origin5、注意属性值为 0 ...

foolbird 1353

【专栏必读】王道考研408计算机网络+湖科大教书匠计算机网络+网络编程万字笔记使用说明及章节导航

本文档汇总了王道考研408计算机网络和湖科大教书匠计算机网络课程的重点内容,包括计算机网络体系结构、物理层、数据链路层、网络层、传输层和应用层的详细讲解。通过ISO/OSI和TCP/IP模型,深入探讨了通信基础、介质访问控制、IP地址、TCP/UDP协议、流量控制和网络编程等关键概念。此外,还提供了Linux网络编程实践,帮助读者巩固理论知识

快乐江湖的博客 2万+

电商行业分析爬虫:抓取行业数据,进行行业分析

电商行业数据分析对于市场研究、竞争分析和商业决策至关重要。通过爬取电商平台的数据,我们可以深入了解市场动态、消费者行为和商品销售情况。本文将介绍如何构建一个电商行业分析爬虫,抓取商品信息、销售数据和用户评价等,并进行数据分析。

u014481728的博客 1636

数据分片的三种方式:哈希、一致性哈希、按照数据范围分片

数据分片就是按照一定的规则,将数据集划分成相互独立、正交的数据子集,然后将数据子集分布到不同的节点上。通过设计合理的数据分片规则,可将系统中的数据分布在不同的物理数据库中,达到提升应用系统数据处理速度的目的。三种常用的数据分片方式:1. 哈希分片2. 一致性哈希分片(Consistent Hash)3. 按照数据范围分片(Range Based)数据分片的应用场景:1. 数据库扩展2. 分布式缓存对集群部署多个缓存节点,提高缓存的处理能力。

wjianwei666的专栏 1147

43、基于机器学习的GNSS信号质量监测方法

本文提出了一种基于支持向量机(SVM)的GNSS信号质量监测方法,旨在有效检测邪恶波形(EWF)威胁并抑制多径干扰对导航精度的影响。通过构建包含现场采集与合成数据的数据集,结合11个相关器测量值、链路预算、仰角和方位角等特征,采用RBF核函数的SVM模型进行分类。研究评估了不同平滑时间窗口对漏检率和误报率的影响,结果表明在约35-40秒平滑时间下性能趋于稳定,并可通过多数投票机制进一步优化检测性能。该方案适用于星载GNSS接收器,在计算资源受限条件下实现了高可靠性与低完整性风险的平衡。

yyy34的博客 193

手把手教你学simulink(41.4)--逆变器电场景示例:基于Simulink的主从控制的多逆变器协同控制(Multi-Inverter Coordinated Control)

需求分析在现代电力系统中,分布式发电和储能系统的广泛应用使得多个逆变器并联运行成为常见的应用场景。为了确保多个逆变器之间的协同工作,实现系统的稳定性和高效性,通常采用主从控制(Master-Slave Control)策略。主从控制通过一个主控制器(Master)来协调多个从控制器(Slave),确保所有逆变器的输出电压、频率和功率分配符合预期目标。本项目将基于Simulink平台,开发一个多逆变器协同控制系统,采用主从控制策略,实现对多个逆变器的精确控制和优化。

MHD0815的博客 308

Outlook Express 6 (OE6) for Win7/Win8/Win10

英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

上一篇: [转]JAVA完全控制Oracle中BLOB、CLOB说明
下一篇: 动态加载外部 css和javascript脚本 文件
devfan
博客等级 码龄22年 45粉丝 88原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值