Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SQLException cannot be resolved to a type

807598Jul 25 2006 — edited Jul 25 2006
Can someone explain this error? It is a compile-time error on the SQLException in the throws statement. I want to go to the catch phrase in the calling routine, so instead of doing a try-catch clause in this routine, I am throwing the SQLException. I know SQLException is the right type to throw because if I remove the throws clause, then the compiler says "Unhandled exception type SQLException". Here is my code. Thanks in advance for your help.
-Jeff
public boolean LCExists(String LCID) throws SQLException {
	// No try catch here because I want caller to process error.
	PreparedStatement pst = Conn.prepareStatement("select LC_ID from ECLS_LOCAL_COUNSEL_MSTR where LC_ID='"+LCID+"'");
	ResultSet rSet =  pst.executeQuery();
	rSet.next();
	return false;

	}
ANSWER: The problem was that I had not imported java.sql.SQLException;


Message was edited by:
JavaJeffrey
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 22 2006
Added on Jul 25 2006
1 comment
3,217 views