can't see the error

Compiling the following code:

--

import java.sql.*;

publicclass JDBC2Mods

{

staticprivate Connection link;

staticprivate Statement statement;

staticprivate ResultSet results;

publicstaticvoid main(String[] args)

{

try

{

//Step 1...

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

//Step 2...

link = DriverManager.getConnection(

"jdbc:odbc:Vrienden","","");

}

catch(ClassNotFoundException cnfEx)

{

System.out.println ("* Unable to load driver! *");

System.exit(1);

}

//For any of a number of reasons, it may not be

//possible to establish a connection...

catch(SQLException sqlEx)

{

System.out.println("* Cannot connect to database! *");

System.exit(1);

}

try

{

//Step 3...

statement = link.createStatement(

ResultSet.TYPE_SCROLL_SENSITIVE,

ResultSet.CONCUR_UPDATABLE);

System.out.println("\nInitial contents of table:\n");

//Steps 4 and 5...

displayTable();

//Start of step 6...

//First the update...

results.absolute(2);//Move to row 2 of ResultSet.

results.updateString("City","Hoofdorp");

results.updateRow();

//Now the insertion...

results.moveToInsertRow();

results.updateInt("Address no.");

results.updateString("First Name","Nathalia");

results.updateString("Last Name","Lopez");

results.updateString("Nickname","Talia");

results.updateString("City","Leiden");

results.insertRow();

//Finally, the deletion...

results.absolute(3);//Move to row 3.

results.deleteRow();

System.out.println("\nNew contents of table:\n");

displayTable();

link.close();

}

catch(SQLException sqlEx)

{

System.out.println("* SQL or connection error! *");

sqlEx.printStackTrace();

System.exit(1);

}

}

publicstaticvoid displayTable()throws SQLException

{

String select ="SELECT * FROM Addresses";

results = statement.executeQuery(select);

System.out.println();

while (results.next())

{

System.out.println("Address no. "

+ results.getInt(1));

System.out.println("Vriendin: "

+ results.getString(3)

+" " + results.getString(2));

System.out.println("Nickname: "

+ results.getString(4));

System.out.println("City: "

+ results.getString(5));

}

}

}

I get the following error:

D:\JavaApplicatie\JDBC2Mods.java:51: cannot find symbol

symbol : method updateInt(java.lang.String)

location: interface java.sql.ResultSet

results.updateInt("Address no.");

^

1 error

--

But I don't see what the problem is, since the results.updateInt is an original code piece...

The column (Address no) is the primary key of the 'Vrienden' database...could the problem be there?

How do I solve this.....

[5300 byte] By [Sherayua] at [2007-11-26 16:42:48]
# 1
At row 51 you wrote:results.updateInt("Address no.");but is missing the new int value of "Address no." column you want to modify:results.updateInt("Address no.", value_int_here);
topfoxya at 2007-7-8 23:09:53 > top of Java-index,Core,Core APIs...
# 2
Even with the value entered, I get the same error... :(
Sherayua at 2007-7-8 23:09:53 > top of Java-index,Core,Core APIs...
# 3

> Even with the value entered, I get the same error...

> :(

That's impossible, as the error states the signature you invoke only to have one parameter (a String) and not two, as the Interface of ResultSet requires. It's either a differen error message or you did not recompile/rewrite the code properly.

stefan.schulza at 2007-7-8 23:09:53 > top of Java-index,Core,Core APIs...