Hallo zusammen,
ich will mit einem Insert eine Access Datenbank befüllen.
Leider kommt bei mir die Meldung:
INSERT INTO buechertabelle (Nr,Titel) VALUES (1,2);
java.sql.SQLException: General error
was mach ich falsch?
ich will mit einem Insert eine Access Datenbank befüllen.
Leider kommt bei mir die Meldung:
INSERT INTO buechertabelle (Nr,Titel) VALUES (1,2);
java.sql.SQLException: General error
was mach ich falsch?
Java:
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import javax.swing.JTable;
public class TableQuery
{
TableConnection tc = new TableConnection();
Table t = new Table();
JTable table = new JTable();
public ArrayList<String> gibMirDaten()
{
String query = "INSERT INTO kontakte(Nr,Titel) VALUES (1,2);";
try
{
tc.stmt = tc.con.createStatement();
ResultSet rs = tc.stmt.executeQuery(query);
while (rs.next())
{
for (int i = 1; i <= t.Spaltenanzahl; i++)
{
tc.ergebnis.add(rs.getString(i));
}
}
}
catch (SQLException e)
{
System.out.println(e);
}
return tc.ergebnis;
}