Exception java.sql.SQLException is never thrown in body of c

1 resposta
J
import <a href="http://java.io">java.io</a>.<em>;

import java.lang.</em>;

import javax.servlet.<em>;

import javax.servlet.http.</em>;

import java.sql.*;

import db.dbConexao;
public class fncCliente {

private dbConexao con;

private ResultSet rs;
public boolean conexao()
{
	try{
		con = new dbConexao();
		if (con!=null)	{return true;}
		else			{return false;}
	}
	[color="green"]catch(SQLException e){[/color]
		System.out.println(e.getMessage());
		return false;
	}
}

exception java.sql.SQLException is never thrown in body of corresponding try statement

1 Resposta

S

Essa exceção nunca será lançada.

Tire o try/catch.

Criado 18 de março de 2005
Ultima resposta 18 de mar. de 2005
Respostas 1
Participantes 2