oracle 上的 select SQL 语句是否会锁定所使用的表以供其他连接更新?这取决于我是否在 jta 事务中进行选择?如何控制这个问题并防止只读 SQL 语句锁定表进行编辑?
我正在尝试将电子邮件直接发送到目标MX服务器,避免使用中继smtp服务器.有条理地,可以让名称服务器列表对dns服务器进行查询.因此,使用此类http://www.eyeasme.com/Shayne/MAILHOSTS/mailHostsLookup.html,我可以获得域的邮件交换服务器列表.
那么,一旦我有了,我该如何继续发送电子邮件?我应该使用javax.mail或如何?如果是,我该如何配置呢?
链接问题:https://github.com/jenca-cloud/docker-bimserver/issues/1
链接到Dockerfile:https://hub.docker.com/r/connoralexander/docker-bimserver/
大家好,我遇到Tomcat 8无法启动服务的问题.使用set username和password成功安装Tomcat 8.0.30.它成功地获取了BIMserver的最新.war文件版本并根据配置自动部署.然后BIMserver服务无法启动.在转到Tomcat管理器后,我们无法手动启动服务,因为它会抛出错误FAIL - Application at context path /BIMserver could not be started
我已经尝试使用以前版本的Tomcat 8和7但是得到了相同的错误.关于启动听众的问题可能是什么?
从catalina日志:
...
05-Jan-2016 11:30:58.047 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
05-Jan-2016 11:30:58.051 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 11752 ms
05-Jan-2016 11:33:02.276 SEVERE [http-nio-8080-exec-5] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
05-Jan-2016 11:33:02.277 SEVERE [http-nio-8080-exec-5] org.apache.catalina.core.StandardContext.startInternal Context [/BIMserver] startup failed due to previous errors …Run Code Online (Sandbox Code Playgroud) 所以我想让下面的代码更紧凑,有没有办法?
也许有一个循环或什么的.尝试了一个for循环,但没有真正解决这个问题......
driver.findElement(By.xpath("//input [@value='1']")).click();
driver.findElement(By.xpath("//input [@value='2']")).click();
driver.findElement(By.xpath("//input [@value='3']")).click();
driver.findElement(By.xpath("//input [@value='4']")).click();
driver.findElement(By.xpath("//input [@value='5']")).click();
driver.findElement(By.xpath("//input [@value='6']")).click();
driver.findElement(By.xpath("//input [@value='7']")).click();
driver.findElement(By.xpath("//input [@value='8']")).click();
driver.findElement(By.xpath("//input [@value='9']")).click();
driver.findElement(By.xpath("//input [@value='10']")).click();
driver.findElement(By.xpath("//input [@value='11']")).click();
driver.findElement(By.xpath("//input [@value='12']")).click();
driver.findElement(By.xpath("//input [@value='13']")).click();
driver.findElement(By.xpath("//input [@value='14']")).click();
driver.findElement(By.xpath("//input [@value='15']")).click();
driver.findElement(By.xpath("//input [@value='16']")).click();
driver.findElement(By.xpath("//input [@value='17']")).click();
driver.findElement(By.xpath("//input [@value='18']")).click();
driver.findElement(By.xpath("//input [@value='19']")).click();
Thread.sleep(1000);
driver.findElement(By.xpath("/html/body/div[1]/section/div[1]/div[2]/form/div/div[2]/div[1]/div[2]/div[7]/div/input[1]")).click();
driver.findElement(By.xpath("/html/body/div[1]/section/div[1]/div[2]/form/div/div[2]/div[1]/div[2]/div[7]/div/input[2]")).click();
driver.findElement(By.xpath("/html/body/div[1]/section/div[1]/div[2]/form/div/div[2]/div[1]/div[2]/div[7]/div/input[3]")).click();
driver.findElement(By.xpath("/html/body/div[1]/section/div[1]/div[2]/form/div/div[2]/div[1]/div[2]/div[7]/div/input[4]")).click();
driver.findElement(By.xpath("/html/body/div[1]/section/div[1]/div[2]/form/div/div[2]/div[1]/div[2]/div[7]/div/input[5]")).click();
driver.findElement(By.xpath("/html/body/div[1]/section/div[1]/div[2]/form/div/div[2]/div[1]/div[2]/div[7]/div/input[6]")).click();
driver.findElement(By.xpath("/html/body/div[1]/section/div[1]/div[2]/form/div/div[2]/div[1]/div[2]/div[7]/div/input[7]")).click();
driver.findElement(By.xpath("/html/body/div[1]/section/div[1]/div[2]/form/div/div[2]/div[1]/div[2]/div[7]/div/input[8]")).click();
driver.findElement(By.xpath("/html/body/div[1]/section/div[1]/div[2]/form/div/div[2]/div[1]/div[2]/div[7]/div/input[9]")).click();
driver.findElement(By.xpath("/html/body/div[1]/section/div[1]/div[2]/form/div/div[2]/div[1]/div[2]/div[7]/div/input[10]")).click();
driver.findElement(By.xpath("/html/body/div[1]/section/div[1]/div[2]/form/div/div[2]/div[1]/div[2]/div[7]/div/input[11]")).click();
driver.findElement(By.xpath("/html/body/div[1]/section/div[1]/div[2]/form/div/div[2]/div[1]/div[2]/div[7]/div/input[12]")).click();
driver.findElement(By.xpath("/html/body/div[1]/section/div[1]/div[2]/form/div/div[2]/div[1]/div[2]/div[7]/div/input[13]")).click();
driver.findElement(By.xpath("/html/body/div[1]/section/div[1]/div[2]/form/div/div[2]/div[1]/div[2]/div[7]/div/input[14]")).click();
driver.findElement(By.xpath("/html/body/div[1]/section/div[1]/div[2]/form/div/div[2]/div[1]/div[2]/div[7]/div/input[15]")).click();
driver.findElement(By.xpath("/html/body/div[1]/section/div[1]/div[2]/form/div/div[2]/div[1]/div[2]/div[7]/div/input[16]")).click();
driver.findElement(By.xpath("/html/body/div[1]/section/div[1]/div[2]/form/div/div[2]/div[1]/div[2]/div[7]/div/input[17]")).click();
driver.findElement(By.xpath("/html/body/div[1]/section/div[1]/div[2]/form/div/div[2]/div[1]/div[2]/div[7]/div/input[18]")).click();
driver.findElement(By.xpath("/html/body/div[1]/section/div[1]/div[2]/form/div/div[2]/div[1]/div[2]/div[7]/div/input[19]")).click();
driver.findElement(By.xpath("/html/body/div[1]/section/div[1]/div[2]/form/div/div[2]/div[1]/div[2]/div[7]/div/input[20]")).click();
driver.findElement(By.xpath("//button [@type='submit']")).click();
Thread.sleep(10000);
Run Code Online (Sandbox Code Playgroud)
这是带有复选框的两个列表.
我正在用Java编写一个聊天客户端,并在尝试编译时得到一个奇怪的错误消息Eclipse 4.4.1:
...
BufferedReader socketIn = new BufferedReader(new InputStreamReader(socket.getInputStream()));
...
String answer;
while (answer = socketIn.readLine() != null) {
incomingTextField.setText(answer);
}
...
Run Code Online (Sandbox Code Playgroud)
错误是:
类型不匹配:无法从布尔值转换为字符串
还有一个小贴士:
将'answer'的类型更改为'boolean'
但是,这没有任何意义,因为根据文档readLine()必须返回String.
如何用JLabel中的Swing在Java中输出一个带有字符串的输出,其中有带索引和幂的符号?例如:x ^ 2(x*x)的输出.
我们如何使用tomcat jdbc为同一个数据库配置2个不同的模式.我们是否需要为不同的模式创建两个不同的tomcat jdbc池连接配置,或者是否可以配置单个jdbc连接池,然后使用此连接池连接到两个不同的模式.
如何模拟DriverManager.getConnection()方法?
我想测试我的方法setUpConnectiontoDB()
我尝试使用PowerMock,easyMock和Mokito本身.我没有找到任何有用的东西.
我的代码:
import java.io.FileInputStream;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;
public class MysqlDAO implements DAO {
private final Properties properties = new Properties();
public MysqlDAO(String configPath) {
loadProperties(configPath);
}
private Properties loadProperties(String configPath) {
try {
properties.load(new FileInputStream(configPath));
} catch (IOException e) {
e.printStackTrace();
}
return this.properties;
}
@Override
public Connection setUpConnectionToDB() {
try {
Class.forName("com.mysql.jdbc.Driver");
return DriverManager.getConnection(
properties.getProperty("url"),
properties.getProperty("user"),
properties.getProperty("passwd"));
} catch (ClassNotFoundException | SQLException e) {
e.printStackTrace();
}
return null;
}
}
Run Code Online (Sandbox Code Playgroud)