[英]Boolean error (Required Boolean ) in java
Connection is not Boolean type class. 连接不是布尔类型类。 Instead of
if(conector.conexion())
you can use like below : 代替
if(conector.conexion())
您可以像下面这样使用:
if(conector.conexion() != null) {
//It ensure connection is not null
//To check connection is not closed
if(!conector.conexion().isClosed()) {
//code...
}
}
For Detail: Connection Docs 有关详细信息: 连接文档
Do following to check if connection instance has been created or not: 请执行以下操作检查连接实例是否已创建:
if(conector.conexion() != null){
//code stuff
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.