[derby] problem with creating a table
Hi! I've a problem with my code.
package jdbc;
import java.sql.*;
publicclass Main{
publicstaticvoid main(String[] args)throws ClassNotFoundException, SQLException{
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
String url ="jdbc:derby:MYDB";
Connection conn = DriverManager.getConnection(url,"nbuser","nbuser");
String s ="CREATE TABLE coffees " +
"(cof_id INT (4) NOT NULL ," +
"cof_name VARCHAR (20) NOT NULL);";
Statement create = conn.createStatement();
ResultSet result = create.executeQuery(s);
}
}
which throws me an sql syntax error (bracket before '4'). But according to http://db.apache.org/derby/manuals/reference/sqlj27.html#CREATE+TABLE+statement query syntax should be ok. DB is created properly. So what is the problem. Please, give me some tip. Greetings.

