I am doing the following:
private void createTable() { try { PreparedStatement psCreateTable = con.prepareStatement("CREATE TABLE COMPANIES(" + "name VARCHAR(50), " + "location VARCHAR(50), " + "address VARCHAR(50), " + "website VARCHAR(50), " + "pit VARCHAR(50), " + "asset_class VARCHAR(50), " + "telephone INTEGER, " + "shares INTEGER, " + "value DOUBLE(,2) UNSIGNED)"); psCreateTable.execute(); } catch (SQLException e) { System.out.println("already exists"); e.printStackTrace(); ;
And I get the following error: java.sql.SQLSyntaxErrorException: Syntax error: encountered "(" on line 1, column 195.
Not sure what to do now, as the SQL query seems valid to me and double-checked it.
source share