我目前有一个java应用程序需要连接并写入<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><script src="./code33_files/lodash.js"></script>
</head><body>
<p id="demo"></p>
<textarea cols="150" rows="15" id="texto">"RBD|X|RBD3|C|92173~GJHGWO.NAYE" "SAMBORNSiPOSSSTHRa1"
"RBD|X|RBD|C|92173~GJHGX4.NAYE" "SAMBORNSiPOSSSTHRa"
"RBD|X3|RBD3|C|92173~GJHGX6.NAYE" "SAMBORNSiPOSSSTHRa1"
"RBD|X|RBD|C|92173~GJHGX8.NAYE" "SAMBORNSiPOSSSTHRa2"
"RBD|X|RBD|C|92173~GJHGXA.NAYE" "SAMBORNSiPOSSSTHRa2"
"RBD|X3|RBD|C|92173~GJHGXC.NAYE" "SAMBORNSiPOSSSTHRa"
</textarea>
<script>
var text = document.getElementById("texto").value;
var splitWords = text.split(/[["\|~]/);
var removeArray = _.remove(splitWords, function (word) {return word !== '' && word !== ' ' && word !== '\n'});
var dict = removeArray.reduce(function(p,c) {
if (p[c] === undefined) {
p[c] = 1;
} else {
p[c]++;
}
return p;
},{});
var filtered = Object.keys(dict).reduce(function (filtered, key) {
if (dict[key] > 1) filtered[key] = dict[key];
return filtered;
}, {});
var colorWords = Object.keys(filtered)
console.log(colorWords)
tagText=[];
for (i = 0; i < colorWords.length; i++) {
tagText.push(text.replace(/colorWords[i]/g, "<p><font color=\"red\">TEXT</font></p>"));
}
console.log(tagText)
</script>
</body></html>
数据库的SQLEXPRESS
实例,此时我的代码将连接到数据库,但仅当我打开SQL Server配置管理器并手动启用SQLserver
协议,将端口设置为1433,然后重新启动服务器。以下链接描述了我所说的https://dzone.com/articles/connecting-sql-server-java这个。
我想将我的应用程序分发给用户,但我不希望用户必须自己手动设置这个我希望我的java代码为他们做这个,这可以在java中做吗?