trying to execute SQL query on an oracle 10g database using java but getting ORA-00911 error I am trying to execute a simple CREATE TABLE query on an oracle10g database using java.  This is what I am doing:

Connection conn = //create connection
//open connection.  No errors/warnings are generated so I assume this succeeds 
Statement statement = conn.createStatement();
ResultSet rs = statement.executeQuery("CREATE TABLE t1 (c1 INTEGER NOT NULL, c2 VARCHAR(100), c3 INTEGER NULL, CONSTRAINT m_pk PRIMARY KEY (c1));");
...
//close connection.  No errors again so I assume it succeeds.


When I execute the command (copying and pasting into terminal window) directly on the command line, it succeeds.  When I run the above java code, this is the error I get:

java.sql.SQLSyntaxErrorException: ORA-00911: invalid character


I dont understand how I could have an invalid character since copying and pasting it into terminal works perfectly fine.
Nevermind. I jumped the gun on posting here! When executing queries in java, I am not suppose to put the semi-colon at the end of the statement. I had tried not putting the semi-colon at the end and it ran without errors but I thought I had checked my database and saw that no table was created. I have now confirmed that dropping the semi-colon has worked!