I have a database that I manage through a jsp file. I want to add some data to it, but I need the data to be taken from a String variable. I tried the following code but the "VALUES" parameter doesn't accept variables. Any help?
function UploadNot() {
<%
String NotificationToUpload = "Test Notification";
Class.forName("org.sqlite.JDBC");
conn = DriverManager.getConnection("jdbc:sqlite:d:\\Databases\\DataBase1.db");
stat = conn.createStatement();
String sql = "INSERT INTO Nots (Notifications) " +
"VALUES (NotificationToUpload);"; //ERROR here, Does not accept variables, only direct Strings
stat.executeUpdate(sql);
%>
}