sql - PreparedStatement Value Error in java -
The forwardword is giving the wrong syntax near the value 'value'. "I am not having problems with my SQL statement.
/ * * Table structure for the history data table in SQL Server * 1) City_ID - Int * 2) City_N - Environments (50) * 3 ) Time - Datetime * 4) Time-time * 5) Humidity - Float * 6) Rain_Info - Float * 7) Snow_info - Float * 8) Temperature - Float * 9) Minimum Temperature - Float * 10) Max_Temperature - float * 11) Description - nvarchar (50) * /
try {string statement string = "WeatherHistoryX (" + "City_ID , "+" City_Name, "+" Time, "+" "Time taken," + "Humdity," + "Rain_Info," + "Snow_Info," + "Temperature," + "Minimum Temperature," + "Maximum Temperature , "" + "," + "Value (?,?,?,?,?,?,?,?)"; PStatement = connection.prepareStatement (statementString); // Description = zero; // Description = connection.createStatement (); java.sql.Date sqlDate = new java.sql.Date (weather.getDate)); Java.sql.Date currentSqlDate = new java.sql.date (current timestamp.getTime ()); pStatement.setInt (1, weather.getCityCode ()); pStatement.s etstring (2, season .getCity ()); pStatement.setDate (3, sqlDate); pStatement.setDate (4, current SQLudit); pStatement.setFloat (5, Weather. ();); pStatement.setFloat (6, Weather .getRainInfo ()); PStatement.setFloat (7, Weather.getSenoinfo ()); pStatement.setFloat (8, Weather. Gate Temperature ()); pStatement.SsetFloat (9, Weather. Gatmin Temperature ()); PStatement.setFloat (10, weather .getMaxTemperature ()); pStatement.setString (11, weather.getDescription ()); PStatement.execute ();
There is an additional "," after your description
Simply remove that comma and add "a place" and a location.
Comments
Post a Comment