How can I add record into my database? I am afraid, that when i do it like this, in database there will be cell containing "veriable1", not veriable1 content. Is this correct?
public class Record
{
public Record(String veriable1, String veriable2) throws IOException, SQLException
{
addRecord();
}
private void addRecord() throws IOException, SQLException
{
try
{
Statement stat = DataBase.Connect().createStatement();
stat.executeUpdate("INSERT INTO tableName "
+ "(veriable1, veriable2) "
+ "VALUES "
+ "(veriable1, veriable2)");
}
finally
{
BazaDanych.Polacz().close();
}
}