Keeps giving me the syntax error. I've searching for the solution but I can't find it.
//Create StockTrades table
try
{
System.out.println("Creating StockTrades table.....");
stmt.executeUpdate("CREATE TABLE StockTrades ("
+"userID TEXT(20) "
+"CONSTRAINT FK1_StockTrades REFERENCES Users (userID), "
+"symbol TEXT(8) "
+"CONSTRAINT FK2_Stocktrades REFERENCES Stocks (symbol), "
+"numStocks INT, "
//the problem seems to be with the six lines of code below this (but I have to
+"date TEXT(30), "
+"priceShare DECIMAL(5,2), "
+"numBought INT,"
+"numSold INT, "
+"totalPrice DECIMAL(9,2), "
+")");
}
catch(Exception e)
{
System.out.println("Exception creating StockTrades table: "+e.getMessage());
}

New Topic/Question
Reply



MultiQuote







|