my function connects to the database but the tables are not created?
i get Syntax error: Encountered "<EOF>" at line 1, column 187.
part of my function that is supposed to create the tables
i get Syntax error: Encountered "<EOF>" at line 1, column 187.
part of my function that is supposed to create the tables
Code:
try
{
int count=statement.executeUpdate("CREATE TABLE contacts("+
"CONTACT_ID INTEGER NOT NULL PRIMARY KEY, "+
"FIRSTNAME VARCHAR(25) not null, "+
"LASTNAME VARCHAR(25) not null, "+
"EMAIL VARCHAR(60) not null, "+
"CONSTRAINT UNIQUE_EMAIL UNIQUE(EMAIL)");
System.out.println("Table contacts created="+count);
count=statement.executeUpdate("create table BOOKS("+
"BOOK_ID INTEGER NOT NULL PRIMARY KEY, "+
"AUTHOR VARCHAR(100) not null, "+
"TITLE VARCHAR(100) not null, "+
"ISBN VARCHAR(10) not null, "+
"ISSUE_YEAR SMALLINT not null, "+
"CONSTRAINT UNIQUE_ISBN UNIQUE(ISBN)");
System.out.println("Table books created="+count);
}
catch (SQLException ex)
{
System.out.println(ex.getMessage());
}
Comment