我Log4j
在我的应用程序中使用的配置文件中编写了以下属性当我运行项目时.
我正在关注message.does意味着在我的项目中配置连接池?如果不是那么它将如何?
INFO:internal.ConnectionProviderInitiator - HHH000130:实例化显式连接提供程序:com.zaxxer.hikari.hibernate.HikariConnectionProvider
我也提到了以下链接
hibernate.datasource.driver-class-name=com.mysql.jdbc.Driver
hibernate.datasource.url=jdbc:mysql://localhost:3306/mydb
hibernate.datasource.username=root
hibernate.datasource.password=root
Run Code Online (Sandbox Code Playgroud)
hibernate.hikari.dataSource.url=jdbc:mysql://localhost:3306/mydb
hibernate.hikari.idleTimeout=10
hibernate.hikari.maximumPoolSize=30
hibernate.hikari.minimumIdle=15
hibernate.connection.provider_class=com.zaxxer.hikari.hibernate.HikariConnectionProvider
hibernate.hikari.dataSourceClassName=com.mysql.jdbc.jdbc2.optional.MysqlDataSource
Run Code Online (Sandbox Code Playgroud) 我目前正在使用Spring MVC4和hibernate 4开发一个应用程序.我已经实现了hibernate二级缓存以提高性能.如果我使用 Redis这是一个内存数据结构存储,用作数据库,缓存等,性能会提高,但会是一个剧烈的变化吗?
我正在使用spring scheduler.这个工作正常,但是每当我需要重新启动tomcat server时,我在application.properties中更改了cron.expression值.有什么方法可以让它像动态一样自动更改会反映出来吗?我也谷歌也没有得到我的应用程序的任何解决方案.我已经给出了如下代码片段:
application.properties
cron.expression=0 58 23 * * ?
Run Code Online (Sandbox Code Playgroud)
@Scheduled(cron = "${cron.expression}", zone = "IST")
public void sendEmail() throws Exception {
}
Run Code Online (Sandbox Code Playgroud) 我正在使用流API读取文件,readFile()同时在第一个循环中循环访问时正在调用方法。我正在获取路径值,如何删除该路径值,因为我正面临数组索引超出范围的异常。文件命名会话为“ FileName_17072018”。
public class RemoveCVVFilesjob {
public static void main(String[] args) throws IOException {
List<String> fileList;
fileList = readFile();
for (String str : fileList) {
String[] strArr = str.split("_");
System.out.println(strArr[1]);
}
}
private static List<String> readFile() throws IOException {
try (Stream<Path> paths = Files.walk(Paths.get("D:\\Projects\\Wallet\\CVVFiles"))) {
List<String> list = paths.map(path -> Files.isDirectory(path) ?
path.getFileName().toString() + '/' :
path.getFileName().toString()).collect(Collectors.toList()
);
return list;
}
}
Run Code Online (Sandbox Code Playgroud) 我正在使用以下邮递员"发送和下载按钮"来点击jersy API,但我无法下载pdf而不是只有正常文件被下载.如果我评论 @RolesAllowed("ROLE_USER")和dircetly从浏览器点击API然后它似乎工作正常,但我想要spring security.please建议解决这个问题
JAVA CODE
@GET
@Path("/{userId}/resume/downloadpdf")
@Produces("application/pdf")
@ApiOperation(value = "Gets user resume pdf",
response = Response.class)
@ApiResponses(value = {
@ApiResponse(code = 200, message = "UserResume information found"),
@ApiResponse(code = 401, message = "Unauthorized request"),
@ApiResponse(code = 404, message = "UserResume information not found"),
@ApiResponse(code = 400, message = "Bad request"),
@ApiResponse(code = 500, message = "Unknown internal server error")
})
@RolesAllowed("ROLE_USER")
@Override
public Response downloadResumePdf(@PathParam("userId") String userId) throws IOException, DocumentException {
String resumeHTMLData ="<h1> hi </h1>";
StreamingOutput …Run Code Online (Sandbox Code Playgroud)