Help: Error - "reflective access to class java.sql.Statement prohibited"

Brown, John JABrown at comdt.uscg.mil
Tue Apr 17 16:21:02 EDT 2001


I've been searching for an example applet that uses the FreeTDS driver -
but haven't found one yet - just applications.

Suggestions welcome.

I'm trying to test FreeTDS with IIs v.4 - and I've posted a sample applet
at : http://38.144.154.100/legal/applets/test_tds_driverII.htm

I am getting an error that I hope somebody can help me with:
reflective access to class java.sql.Statement prohibited

The code that I expect is causing this is below: (suspect code
hightlighted in bold)
======================================================
void getRecords(String SQL) {
	Properties props=new Properties();

try {
         Class.forName("com.internetcds.jdbc.tds.Driver").newInstance();
        } catch (Exception e) {
            StatusLabel.setText("Failed to load JDBC/ODBC driver.");
		System.out.println(e.getMessage());
		System.out.println(e.toString());
		e.printStackTrace();
		return;
        }

try {
         Connection  connection       = Common.getConnection();
	<b>Statement</b> statement=connection.createStatement();
	int columns=0;
	int pos=0;
	SessionTable.clear();
	String output="";
	//execute list function
	<b>ResultSet</b> rs = statement.executeQuery(SQL);
	<b>ResultSetMetaData</b> md = rs.getMetaData();
	columns=rs.getMetaData().getColumnCount();
================================================================
I made this code mostly from looking at the example applications (would
have used an applet version but I found none). I've imported java.sql.* -
and I think that my calls above to <b>ResultSet, Statement, and
ResultSetMetaData</b> are the problem.  I just don't know how to fix.

Thanks!




More information about the FreeTDS mailing list