我有一个超过100万行的用户表(Oracle 11g数据库),其中包含纯文本的所有用户密码,我试图使用SHA512算法(哈希和盐)进行哈希.从下面开始是我的Java类从用户表读取所有记录,哈希并更新回用户表.
setFetchSize(1000)
)try {
ps = con.prepareStatement("update user set password=? where ID=?");
psSel = con.prepareStatement("select ID, password from user");
psSel.setFetchSize(1000);
rs = psSel.executeQuery();
String hashPassword = null;
while (rs.next()) {
long id = rs.getLong(1);
String pwd = rs.getString(2);
hashPassword = <<CALL TO PASSWORD HASHING UTIL>>;
ps.setString(1, hashPassword);
ps.setLong(2, id);
ps.addBatch();
//Every 5000 records update and commit
if(++count % batchSize == 0) {
ps.executeBatch();
con.commit();
}
}
ps.executeBatch();
con.commit();
} …
Run Code Online (Sandbox Code Playgroud) 我2.3.0
从 Spring Initializr 到我的 Windows8.1
操作系统生成了一个简单的演示项目(版本),下面是基本结构
C:.\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80src\n \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80main\n \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80java\n \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80com\n \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80example\n \xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80demo\n \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80resources\n \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80test\n \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80java\n \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80com\n \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80example\n \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80demo\n
Run Code Online (Sandbox Code Playgroud)\n\n我尝试运行mvnw.cmd clean
并收到以下错误:
C:\\Users\\Downloads\\demo\\demo>mvnw.cmd clean\n"}" was unexpected at this time.\n
Run Code Online (Sandbox Code Playgroud)\n\n下面是 powershell 中的相同输出
\n\nPS C:\\Users\\Downloads\\demo\\demo> .\\mvnw.cmd clean\n"}" was unexpected at this time.\nPS C:\\Users\\Downloads\\demo\\demo>\n
Run Code Online (Sandbox Code Playgroud)\n\n我发现问题发生在mvnw.cmd
文件中的以下几行中:
powershell -Command "&{"^\n "$webclient = new-object System.Net.WebClient;"^\n "if (-not ([string]::IsNullOrEmpty(\'%MVNW_USERNAME%\') -and [string]::IsNullOrEmpty(\'%MVNW_PASSWORD%\'))) {"^\n "$webclient.Credentials = new-object System.Net.NetworkCredential(\'%MVNW_USERNAME%\', …
Run Code Online (Sandbox Code Playgroud)