apache derby_Apache Derby数据库JVM安全策略

apache derby

抽象

我已经发布了许多有关Derby的博客:

  • Derby数据库备份
  • 同一主机上的多个Derby网络服务器
  • Apache Derby数据库用户和权限
  • 与Maven和内存中Derby数据库的集成测试

这本不打算是一个系列。 但是多年来,我越来越多地使用Derby。 我开始将Derby用作微服务体系结构的首选数据库。 这些是个人使用的应用程序,因此Derby绰绰有余。 即使这些是个人使用的应用程序,我也需要具有有限用户权限的 多台服务器 ,当然还有数据库备份和还原 。 最终要求是安全性。 我使用derby usr帐户在Ubuntu Linux VM上运行Derby数据库。 尽管derby usr帐户对VM的权限有限,但是任何额外的安全层都是好的。 因此,本博客的目的是演示如何使用Java安全策略运行Derby,以限制JVM的权限并增强运行时安全性。

免责声明

这篇文章仅供参考。 在使用所提供的任何信息之前,请认真思考。 从中学到东西,但最终自己做出决定,风险自负。

要求

我使用以下主要技术完成了本文的所有工作。 您可能可以使用不同的技术或版本来做相同的事情,但不能保证。

  • Apache Derby 10.14.2.0
  • Java zulu11.39.15-ca-jdk11.0.7-linux_x64

我将不涉及下载和安装这些技术的过程。 我将其留给您练习。

注意从版本10.15开始,Derby项目已更新为使用Java 9模块系统。 结果,JAR文件已经发生了很大变化。 下面的security.policy不太可能与10.15+版本一起使用。 截至本博客的发布日期,我还没有尝试过。

Linux bash脚本

为了管理Derby使其与Java安全策略一起运行,您需要3个脚本。 第一个脚本将设置设置环境变量以配置Derby。 第二个脚本将启动Derby网络服务器,并传递正确的命令行参数。 第三台将停止Derby网络服务器。

清单1.1向您展示了这些脚本中的第一个。 它导出具有特定配置值的许多系统环境变量,这些配置值专门用于在环境中运行Derby。

清单1.1 – setenv.sh

 #!/bin/bash  export DERBY_HOME=/home/derby/opt/derby  export PATH= "$DERBY_HOME/bin:$PATH"  echo "DERBY_HOME=$DERBY_HOME"  export JAVA_HOME=/home/derby/opt/java  echo "JAVA_HOME=$JAVA_HOME"  export NS_HOME=/var/local/derby/ 1527  mkdir -p $NS_HOME  echo "NS_HOME=$NS_HOME"  export NS_PORT= 1527  echo "NS_PORT=$NS_PORT"  export NS_HOST= 0.0 . 0.0  echo "NS_HOST=$NS_HOST"  export DERBY_OPTS= ""  export DERBY_OPTS= "$DERBY_OPTS -Dderby.drda.host=$NS_HOST"  export DERBY_OPTS= "$DERBY_OPTS -Dderby.drda.portNumber=$NS_PORT"  export DERBY_OPTS= "$DERBY_OPTS -Dderby.system.home=$NS_HOME"  # Security Policy  export DERBY_OPTS= "$DERBY_OPTS -Dderby.stream.error.logSeverityLevel=0"  export DERBY_OPTS= "$DERBY_OPTS -Dderby.security.port=$NS_PORT"  export DERBY_OPTS= "$DERBY_OPTS -Dderby.install.url=file:$DERBY_HOME/lib/"  export DERBY_OPTS= "$DERBY_OPTS -Djava.security.manager"  export DERBY_OPTS= "$DERBY_OPTS -Djava.security.policy=$NS_HOME/security.policy" 

DERBY_HOME不言自明。 这是解压缩(安装)Derby的地方。 将Derby的bin目录添加到PATH

JAVA_HOME是不言自明的。 这是解压缩(安装)Java的地方。 将Java的bin目录添加到PATH

NS_HOME“N etwork 小号 erver家”。 这是Derby网络服务器将用于存储其配置和数据库的目录。 每当在此Derby网络服务器上创建新数据库时,都会在NS_HOME下为新数据库创建一个新的子目录。 这允许在同一主机上运行的多个Derby网络服务器将其数据分开。

NS_PORT“N etwork 小号 erver端口”。 这是Derby网络服务器用来侦听连接的端口。 这允许多个Derby网络服务器在同一主机上运行。

NS_HOST“N etwork 小号 erver主机”。 它设置侦听连接时Derby网络服务器使用的网络接口。 默认情况下,Derby网络服务器仅在127.0.0.1的回送地址上侦听连接。 此默认值表示客户端必须与网络服务器在同一主机上运行-不太有用。 通过将主机设置为0.0.0.0 ,Derby网络服务器将侦听主机上任何网络接口上的连接。 如果您的VM具有多个网络接口,则应将NS_HOST设置为这些接口之一的IP。 设置此值可使客户端成为远程客户端。

DERBY_OPTS是用于将所有配置选项获取到Derby的系统属性。 通过将适当的Derby系统属性及其关联值连接在一起来创建其值。 使用或不使用安全策略来启动Derby都需要前三个属性。

  1. derby.drda.host
  2. derby.drda.portNumber
  3. derby.system.home

配置Derby使其与安全策略一起运行时,需要最后5个属性。

  1. derby.stream.error.logSeverityLevel
  2. derby.security.port
  3. derby.install.url
  4. java.security.manager
  5. java.security.policy

其中最重要的特性之一是java.security.policy=$NS_HOME/security.policy" 。这个属性指向的值security.policy文件,该文件将配置Java SecurityManager ,你会读到有关创建security.policy文件接下来,您将看一下启动服务器的脚本。

清单1.2向您展示了这些脚本的第二个。 它会启动Derby网络服务器,并传递正确的命令行参数,因此Derby会以安全策略运行。

清单1.2 – start.sh

 #!/bin/bash  # Directory of the script  SD=$( cd "$( dirname " ${BASH_SOURCE[ 0 ]} " )" && pwd )  # Source in common variables  source $SD/setenv.sh  # Symlink the network server configurations  ln -sf $SD/../conf/security.policy $NS_HOME/security.policy  ln -sf $SD/../conf/derby.properties $NS_HOME/derby.properties  startNetworkServer 

SDS CRIPT d irectory。 该评估确定start.sh脚本的标准文件系统位置,并将其分配给SD 。 当引用其他脚本时,这很有用。

来源不言自明。 它在系统环境变量中提供源以配置Derby网络服务器。 有关详细信息,请参见清单1.1。

Symlink配置适用于security.policy文件和derby.properties文件。 符号链接的目的是将这两个文件放入$NS_HOME目录。 Derby在$NS_HOME目录中寻找derby.properties文件,因此它必须存在。 为了保持一致性(不是必须的),您还希望将security.policy文件放在此处。 在清单1.1中, java.security.policy=$NS_HOME/security.policy"属性配置了此位置。对于我的环境,我将$NS_HOME目录从保存管理脚本和其他Derby配置文件的目录中分离出来。原因我这样做是因为灾难恢复,我认为$NS_HOME目录是$NS_HOME ,这意味着如果由于某种原因它丢失了(删除,磁盘驱动器错误,损坏,建立了新的VM等),我必须能够恢复数据库数据,管理脚本( setenv.shstart.shstop.sh )和配置文件( security.policyderby.properties从我的云备份)。 真正的配置文件的保留之外$NS_HOME目录, start.sh将它们在正确的位置符号链接。

startNetworkServer是Derby提供的脚本( $DERBY_HOME/bin ),用于启动网络服务器。 该DERBY_OPTS变量-在设置setenv.sh -用于配置网络服务器。 默认情况下,Derby使用有限的安全策略运行。 但是,由于配置了安全策略,因此Derby将使用您的配置而不是默认配置。

现在,您具有Derby服务器环境配置和启动脚本。 您还没有能够停止Derby网络服务器的功能。 停止服务器很容易。 您将查看下一个用于停止服务器的脚本。

注意仍然还需要security.policy文件。 我保证,您将在短时间内阅读到有关它的信息!

清单1.3向您展示了这些脚本的第三个。 它将停止Derby网络服务器。 不太令人兴奋,但是对服务器进行有管理的关闭以防止数据损坏很重要。

清单1.3 – stop.sh

 #!/bin/bash  # Directory of the script  SD=$( cd "$( dirname " ${BASH_SOURCE[ 0 ]} " )" && pwd )  # Source in common variables  source $SD/setenv.sh  stopNetworkServer 

所有这些都是不言自明的。 此脚本不需要进一步的注释。

security.policy文件

Derby随附一个演示安全策略文件。 它位于DERBY_HOME/demo/templates/security.policy 。 使用此文件作为起点,我能够生成满足以下要求的最终版本:

  • 网络(远程)访问
  • 本地主机访问
  • 启动
  • 关掉
  • 后备

清单2.1 – security.policy

 //  //  Licensed to the Apache Software Foundation (ASF) under one or more  //  contributor license agreements. See the NOTICE file distributed with  //  this work for additional information regarding copyright ownership.  //  The ASF licenses this file to You under the Apache License, Version 2.0  //  (the "License"); you may not use this file except in compliance with  //  the License. You may obtain a copy of the License at  //  // http://www.apache.org/licenses/LICENSE-2.0  //  //  Unless required by applicable law or agreed to in writing, software  //  distributed under the License is distributed on an "AS IS" BASIS,  //  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  //  See the License for the specific language governing permissions and  //  limitations under the License.  //  grant codeBase "${derby.install.url}derby.jar"  { // These permissions are needed for everyday, embedded Derby usage. // permission java.lang.RuntimePermission "createClassLoader" ; permission java.util.PropertyPermission "derby.*" , "read" ; permission java.util.PropertyPermission "user.dir" , "read" ; permission org.apache.derby.security.SystemPermission "engine" , "usederbyinternals" ; // The next two properties are used to determine if the VM is 32 or 64 bit. // permission java.util.PropertyPermission "sun.arch.data.model" , "read" ; permission java.util.PropertyPermission "os.arch" , "read" ; permission java.io.FilePermission "${derby.system.home}" , "read" ; permission java.io.FilePermission "${derby.system.home}${/}-" , "read,write,delete" ; // Needed by sysinfo. A file permission is needed to check the existence of // jars on the classpath. You can limit this permission to just the locations // which hold your jar files. This block is reproduced for all codebases // which include the sysinfo classes--the policy file syntax does not let you // grant permissions to several codebases all at once. // permission java.util.PropertyPermission "user.*" , "read" ; permission java.util.PropertyPermission "java.home" , "read" ; permission java.util.PropertyPermission "java.class.path" , "read" ; permission java.util.PropertyPermission "java.runtime.version" , "read" ; permission java.util.PropertyPermission "java.fullversion" , "read" ; permission java.lang.RuntimePermission "getProtectionDomain" ; permission java.io.FilePermission "java.runtime.version" , "read" ; permission java.io.FilePermission "java.fullversion" , "read" ; permission java.io.FilePermission "${derby.install.path}${/}-" , "read" ; permission java.io.FilePermission "/tmp${/}-" , "read,write,delete" ; // Permissions needed for JMX based management and monitoring. // // Allows this code to create an MBeanServer: // permission javax.management.MBeanServerPermission "createMBeanServer" ; // Allows access to Derby's built-in MBeans, within the domain // org.apache.derby. Derby must be allowed to register and unregister these // MBeans. To fine tune this permission, see the javadoc of // javax.management.MBeanPermission or the JMX Instrumentation and Agent // Specification. // permission javax.management.MBeanPermission "org.apache.derby.*#[org.apache.derby:*]" , "registerMBean,unregisterMBean" ; // Trusts Derby code to be a source of MBeans and to register these in the // MBean server. // permission javax.management.MBeanTrustPermission "register" ; // Gives permission for jmx to be used against Derby but only if JMX // authentication is not being used. In that case the application would need // to create a whole set of fine-grained permissions to allow specific users // access to MBeans and actions they perform. // permission org.apache.derby.security.SystemPermission "jmx" , "control" ; permission org.apache.derby.security.SystemPermission "engine" , "monitor" ; permission org.apache.derby.security.SystemPermission "server" , "monitor" ; // getProtectionDomain is an optional permission needed for printing // classpath information to derby.log // permission java.lang.RuntimePermission "getProtectionDomain" ; // The following permission must be granted for Connection.abort(Executor) to // work. Note that this permission must also be granted to outer // (application) code domains. // permission java.sql.SQLPermission "callAbort" ; permission java.sql.SQLPermission "deregisterDriver" ; // Needed by FileUtil#limitAccessToOwner // permission java.lang.RuntimePermission "accessUserInformation" ; permission java.lang.RuntimePermission "getFileStoreAttributes" ;  };  grant codeBase "${derby.install.url}derbynet.jar"  { // These permissions lets the Network Server manage connections from clients. // Accept connections from any host. Derby is listening to the host interface // specified via the -h option to "NetworkServerControl start" on the command // line, via the address parameter to the // org.apache.derby.drda.NetworkServerControl constructor in the API or via // the property derby.drda.host; the default is localhost. You may want to // restrict allowed hosts, eg to hosts in a specific subdomain, // eg "*.example.com". // permission java.net.SocketPermission "*" , "accept" ; // Allow the server to listen to the socket on the port specified with the // -p option to "NetworkServerControl start" on the command line, or with // the portNumber parameter to the NetworkServerControl constructor in the // API, or with the property derby.drda.portNumber. The default is 1527. permission java.net.SocketPermission "localhost:${derby.security.port}" , "listen" ; permission java.net.SocketPermission "${derby.drda.host}:${derby.security.port}" , "listen" ; // Needed for server tracing. // permission java.io.FilePermission "${derby.drda.traceDirectory}${/}-" , "read,write,delete" ; // Needed by FileUtil#limitAccessToOwner // permission java.lang.RuntimePermission "accessUserInformation" ; permission java.lang.RuntimePermission "getFileStoreAttributes" ; // Needed for NetworkServerMBean access (see JMX section above) // permission org.apache.derby.security.SystemPermission "server" , "control,monitor" ; permission org.apache.derby.security.SystemPermission "engine" , "usederbyinternals" ; // Needed by sysinfo. A file permission is needed to check the existence of // jars on the classpath. You can limit this permission to just the locations // which hold your jar files. This block is reproduced for all codebases // which include the sysinfo classes--the policy file syntax does not let you // grant permissions to several codebases all at once. // permission java.util.PropertyPermission "user.*" , "read" ; permission java.util.PropertyPermission "java.home" , "read" ; permission java.util.PropertyPermission "java.class.path" , "read" ; permission java.util.PropertyPermission "java.runtime.version" , "read" ; permission java.util.PropertyPermission "java.fullversion" , "read" ; permission java.lang.RuntimePermission "getProtectionDomain" ; permission java.io.FilePermission "java.runtime.version" , "read" ; permission java.io.FilePermission "java.fullversion" , "read" ; permission java.io.FilePermission "${derby.install.path}${/}-" , "read" ; permission java.util.PropertyPermission "derby.*" , "read,write" ; permission java.net.SocketPermission "localhost:${derby.security.port}" , "connect,resolve" ; permission java.net.SocketPermission "${derby.drda.host}:${derby.security.port}" , "connect,resolve" ;  };  grant codeBase "${derby.install.url}derbytools.jar"  { // Needed by sysinfo. A file permission is needed to check the existence of // jars on the classpath. You can limit this permission to just the locations // which hold your jar files. This block is for all codebases which include // the sysinfo classes--the policy file syntax does not let you grant // permissions to several codebases all at once. // permission java.util.PropertyPermission "user.*" , "read" ; permission java.util.PropertyPermission "java.home" , "read" ; permission java.util.PropertyPermission "java.class.path" , "read" ; permission java.util.PropertyPermission "java.runtime.version" , "read" ; permission java.util.PropertyPermission "java.fullversion" , "read" ; permission java.lang.RuntimePermission "getProtectionDomain" ; permission java.io.FilePermission "<<ALL FILES>>" , "read" ; permission java.io.FilePermission "java.runtime.version" , "read" ; permission java.io.FilePermission "java.fullversion" , "read" ; permission java.util.PropertyPermission "*" , "read,write" ;  };  grant codeBase "${derby.install.url}derbyclient.jar"  { // Needed by sysinfo. A file permission is needed to check the existence of // jars on the classpath. You can limit this permission to just the locations // which hold your jar files. This block is reproduced for all codebases // which include the sysinfo classes--the policy file syntax does not let you // grant permissions to several codebases all at once. // permission java.util.PropertyPermission "user.*" , "read" ; permission java.util.PropertyPermission "java.home" , "read" ; permission java.util.PropertyPermission "java.class.path" , "read" ; permission java.util.PropertyPermission "java.runtime.version" , "read" ; permission java.util.PropertyPermission "java.fullversion" , "read" ; permission java.lang.RuntimePermission "getProtectionDomain" ; permission java.io.FilePermission "${derby.install.path}${/}-" , "read" ; // The following permission must be granted for Connection.abort(Executor) to // work. Note that this permission must also be granted to outer // (application) code domains. // permission java.sql.SQLPermission "callAbort" ; permission java.net.SocketPermission "localhost:${derby.security.port}" , "connect,resolve" ; permission java.net.SocketPermission "${derby.drda.host}:${derby.security.port}" , "connect,resolve" ;  }; 

策略文件很多。使用Java 20年后,我只遇到过几次。 我不假装知道策略文件中的所有内容。 我所知道的是,此文件可满足我的所有要求。 每次Derby更新都需要进行测试,并且可能需要进行一些调整。 derby-users@db.apache.org邮件列表是您最好的信息来源。

从derby-users@db.apache.org邮件列表向Rick Hillegas大声喊叫,以帮助我获得此版本的策略文件。 他提供了大部分内容,我添加了以下内容以满足我的要求。

第50行permission java.io.FilePermission "/tmp${/}-", "read,write,delete"; 。 我的数据库备份过程使用CALL SYSCS_UTIL.SYSCS_BACKUP_DATABASE ('/tmp/resiste-backup/1527') 。 因此, derby.jar文件需要对文件系统上的/tmp目录具有读取,写入,删除权限,以便可以将备份写入该目录。

第92行permission java.sql.SQLPermission "deregisterDriver"; 。 使用ij工具管理我的Derby数据库时,在derby.log文件中发现了关于deregisterDriver的异常。 因此,我也将此权限添加到了derby.jar文件中。

第160行permission java.net.SocketPermission "${derby.drda.host}:${derby.security.port}", "connect,resolve"; 。 属性derby.drda.hostderby.security.port在设定setenv.sh脚本(列表1.1)。 我必须添加此权限,因为远程(非本地主机)客户端可以访问我的Derby网络服务器。 在setenv.sh ,我用-Dderby.drda.host=0.0.0.0覆盖默认的本地主机唯一接口监听。 我还发现在测试stop.sh脚本(清单1.3)时,我需要在策略文件中使用stop.sh

摘要

而已。 希望您喜欢学习如何使用安全策略来运行Derby网络服务器。

翻译自: https://www.javacodegeeks.com/2020/04/apache-derby-database-jvm-security-policy.html

apache derby

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/331434.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

java数据库编程——事务

【0】README 1&#xff09; 本文部分文字描述转自 core java volume 2 &#xff0c; 测试源代码均为原创&#xff0c; 旨在理解 java数据库编程——事务 的基础知识 &#xff1b; 2&#xff09;for database connection config, please visit &#xff1a; https://github.co…

算法九之基数排序

一、基数排序 &#xff08;1&#xff09;基数排序的简介 基数排序不同于其他的排序算法&#xff0c;它不是基于比较的算法。基数排序是一种借助多关键字排序的思想对单逻辑关键字进行排序的方法。它是一种稳定的排序算法。  通常用于对数的排序选择的是最低位优先法&#xff…

在Spring中使用多个动态缓存

在第三篇有关Spring&#xff08;长时间&#xff09;的缓存管理器的文章中&#xff0c;我想通过展示如何配置多个动态创建缓存的缓存管理器来扩展前 两个 。 Spring具有CompositeCacheManager &#xff0c;从理论上讲&#xff0c;它应该允许使用多个缓存管理器。 它通过询问基础…

java数据库编程——元数据(metadata)+web 与企业应用中的连接管理

【0】README 1&#xff09; 本文部分文字描述转自 core java volume 2 &#xff0c; 测试源代码均为原创&#xff0c; 旨在理解 java数据库编程——元数据&#xff08;metadata&#xff09;web 与企业应用中的连接管理 的基础知识 &#xff1b; 2&#xff09;for database co…

托管 非托管_如何在托管的Kubernetes上备份Neo4J

托管 非托管在下面的视频中&#xff0c;我将解释如何对在托管Kubernetes环境中运行的Neo4J实例进行完整和增量备份。 我们将使用其他Pod进行远程备份&#xff0c;并将备份数据存储在托管环境提供的持久卷上。 如果您想知道如何将Neo4J部署到托管Kubernetes&#xff0c;请查看以…

java国际化——Locale+数字格式

【0】README 1&#xff09; 本文部分文字描述转自 core java volume 2 &#xff0c; 测试源代码均为原创&#xff0c; 旨在理解 java国际化——Locale数字格式 的基础知识 &#xff1b; 2&#xff09; java 编程语言是第一个设计成为全面支持国际化的语言。 2.1&#xff09;…

Linux指令类型(一)change指令

一、change指令 chattr chgrp chmod chown chfn chsh chroot 二、ch指令详细介绍 &#xff08;1&#xff09;chattr 全名&#xff1a;change attribute 作用&#xff1a;chattr命令用于改变文件属性 语法&#xff1a;chattr [-RV][-v<版本编号>]…

restful rest_HATEOAS的RESTful服务。 REST:刷新器

restful rest在这篇文章中&#xff0c;我们将介绍有关HATEOAS的RESTful服务的综合文章。 REST&#xff1a;刷新器。 1.简介 “不好了&#xff01; 请&#xff0c;不要再发表有关REST的文章&#xff01;” 你们中的许多人可能会尖叫&#xff0c;这是正确的。 已经出版了太多的…

Unicode® Character Name Index

【0】README 0.1&#xff09; there are unicodes for varients of alphabet a, for that of b, c, or d and so on, please visit http://unicode.org/charts/charindex.html [A] A WITH ACUTE, LATIN CAPITAL LETTER 00C1 A WITH ACUTE, LATIN SMALL LETTER 00E1 A WITH…

java8 hash算法

一、hash算法哈希算法将任意长度的二进制值映射为较短的固定长度的二进制值&#xff0c;这个小的二进制值称为哈希值。哈希值是一段数据唯一且极其紧凑的数值表示形式。如果散列一段明文而且哪怕只更改该段落的一个字母&#xff0c;随后的哈希都将产生不同的值。要找到散列为同…

exchanger_如何通过示例在Java中使用Exchanger

exchanger大家好&#xff0c;如果您在并发Java应用程序中工作&#xff0c;那么您可能听说过java.util.concurrent包的Exchanger类。 Java中的Exchanger是Java 1.5中与CountDownLatch &#xff0c; CyclicBarrier和Semaphores一起引入的另一个并发或同步实用程序。 顾名思义&…

Java Enumeration接口与Iterator接口

一、Enumeration接口 Enumeration接口中定义了一些方法&#xff0c;通过这些方法可以枚举&#xff08;一次获得一个&#xff09;对象集合中的元素。 这种传统接口已被迭代器取代&#xff0c;虽然Enumeration 还未被遗弃&#xff0c;但在现在代码中已经被很少使用了。尽管如此&a…

java国际化——日期和时间+排序

【0】README 1&#xff09; 本文部分文字描述转自 core java volume 2 &#xff0c; 测试源代码均为原创&#xff0c; 旨在理解 java国际化——日期和时间排序 的基础知识 &#xff1b; 【1】日期和时间 1&#xff09;当格式化日期和时间时&#xff0c;需要考虑4个与 Locale …

jvm 垃圾收集算法_JVM垃圾收集和优化

jvm 垃圾收集算法总览 在对系统进行性能相关问题的故障排除时&#xff0c;内存优化是一个需要深入分析每个系统在内存中存储的内容&#xff0c;存储时间和访问方式的场所。 这篇文章是要对背景信息进行注释&#xff0c;并在此工作中要注意一些要点&#xff0c;这些工作要针对基…

数据库SQL索引

一、索引的意义 表中创建索引&#xff0c;以便更加快速高效地查询数据。 用户无法看到索引&#xff0c;它们只能被用来加速搜索/查询。 注释&#xff1a;更新一个包含索引的表需要比更新一个没有索引的表花费更多的时间&#xff0c;这是由于索引本身也需要更新。因此&#x…

java国际化——消息格式化+文本文件和字符集

【0】README 1&#xff09; 本文部分文字描述转自 core java volume 2 &#xff0c; 测试源代码均为原创&#xff0c; 旨在理解 java国际化——消息格式化文本文件和字符集 的基础知识 &#xff1b; 2&#xff09; 由于本文涉及到的源代码都比较简单&#xff0c;所以直接将全…

java 8 新功能详解_Java 8和Java 14之间的新功能

java 8 新功能详解从版本9开始&#xff0c;Java每6个月就有一次新功能&#xff0c;因此很难跟踪这些新更改。 互联网上的大多数信息都描述了最近2个Java版本之间的变化。 但是&#xff0c;如果您的情况与我相似&#xff0c;则说明您使用的不是Java的最新版本&#xff0c;而是使…

Tomcat配置虚拟内存

一、Tomcat启动参数JAVA_OPTS参数说明   -server 启用jdk 的 server 版&#xff1b;   -Xms java 虚拟机初始化时的堆最小内存&#xff1b;   -Xmx java 虚拟机可使用堆的最大内存&#xff1b;   -XX: PermSize 非堆内存永久保留区域   -XX:MaxPermS…

ISO语言代码和国家代码+Locale常量+ISO货币符号

【1】ISO语言代码和国家代码 【2】Locale常量 【3】ISO货币符号

djl和ljl_使用Spring Boot和DJL进行深度学习

djl和ljl总览 这是Spring Boot上的另一篇文章 &#xff0c;该文章将展示如何使用Deep Java Library &#xff08;DJL&#xff09;构建示例Web应用程序&#xff0c; Deep Java Library &#xff08;DJL&#xff09;是Java的开源深度学习库&#xff0c;用于诊断X射线图像上的COVI…