import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
import javax.swing.*;
import javax.swing.event.*;
import java.sql.*;
public class updateCronFiles {
public updateCronFiles() throws Exception
{
try {
System.out.println("Hi " retrieveInformation();
} catch ( Throwable t ) {
System.out.println("problem ...."
t.printStackTrace();
}
}
protected void retrieveInformation() throws Exception {
Connection con;
String query, url;
int result;
Statement statement;
try {
try {
System.out.println("Connection.."
} catch (java.lang.ClassNotFoundException e ) {
System.out.println("JDBC Driver not found ... "
throw ( e );
} // end of try
} catch ( SQLException sqlex ) {
sqlex.printStackTrace();
System.out.println("inside retrieveInformation in updateCronFiles class"
throw (sqlex);
} // end of catch
} // end of retrieveInformation
} // end of updateCronFiles class
But I keep getting compile error:
updateCronFiles.java:105: exception java.sql.SQLException is never thrown in body of corresponding try statement
} catch ( SQLException sqlex ) {
^
1 error
Any help is FULLY APPRECIATED.
import java.awt.event.*;
import java.io.*;
import java.util.*;
import javax.swing.*;
import javax.swing.event.*;
import java.sql.*;
public class updateCronFiles {
public updateCronFiles() throws Exception
{
try {
System.out.println("Hi " retrieveInformation();
} catch ( Throwable t ) {
System.out.println("problem ...."
t.printStackTrace();
}
}
protected void retrieveInformation() throws Exception {
Connection con;
String query, url;
int result;
Statement statement;
try {
try {
System.out.println("Connection.."
} catch (java.lang.ClassNotFoundException e ) {
System.out.println("JDBC Driver not found ... "
throw ( e );
} // end of try
} catch ( SQLException sqlex ) {
sqlex.printStackTrace();
System.out.println("inside retrieveInformation in updateCronFiles class"
throw (sqlex);
} // end of catch
} // end of retrieveInformation
} // end of updateCronFiles class
But I keep getting compile error:
updateCronFiles.java:105: exception java.sql.SQLException is never thrown in body of corresponding try statement
} catch ( SQLException sqlex ) {
^
1 error
Any help is FULLY APPRECIATED.