title: You have an error in your SQL syntax;check the manual that corresponds to your MariaDB server version for the right syntax to use near table at line 1
body: <p>I'm trying to create to the table into my database. And this is my code..
  (my db name is koneksi, and my table name is table)</p>
  <pre><code>private void datatable(){
  DefaultTableModel tbl = new DefaultTableModel();
  tbl.addColumn(&quot;Nomor Induk&quot;);
  tbl.addColumn(&quot;Nama Siswa&quot;);
  tbl.addColumn(&quot;Kelas&quot;);
  tbl.addColumn(&quot;Jenis Kelamin&quot;);
  tbl.addColumn(&quot;Nilai Harian&quot;);
  tbl.addColumn(&quot;Nilai UTS&quot;);
  tbl.addColumn(&quot;Nilai UAS&quot;);
  tbl.addColumn(&quot;Nilai Akhir&quot;);
  tbl.addColumn(&quot;Grade&quot;);
  tbl.addColumn(&quot;Keterangan&quot;);
  table.setModel(tbl);
  try{
  Statement panggil = (Statement)koneksi.gettConnection().createStatement();
  ResultSet res = panggil.executeQuery(&quot;select * from table&quot;);
  while(res.next()){
      tbl.addRow(new Object[]{
      res.getString(&quot;nis&quot;),
      res.getString(&quot;nama&quot;),
      res.getString(&quot;kelas&quot;),
      res.getString(&quot;jeniskelamin&quot;),
      res.getString(&quot;harian&quot;),
      res.getString(&quot;uts&quot;),
      res.getString(&quot;uas&quot;),
      res.getString(&quot;akhir&quot;),
      res.getString(&quot;grade&quot;),
      res.getString(&quot;ket&quot;),
  });
  table.setModel(tbl);
  }
  
  }catch (Exception e)
  {
  JOptionPane.showMessageDialog(rootPane, e.getMessage());
     }
  }
  </code></pre>
  <p>And this is my koneksi.java code..</p>
  <pre><code>import java.sql.Connection;
  import java.sql.DriverManager;
  import javax.swing.JOptionPane;
  
  
  public class koneksi {
  static Connection sambung;
  public static Connection gettConnection(){
  try{
      sambung=DriverManager.getConnection(&quot;jdbc:mysql://localhost/koneksi&quot;,&quot;root&quot;,&quot;&quot;);
  }catch (Exception e){
      JOptionPane.showConfirmDialog(null,&quot;Connection Failed&quot;);
  }return sambung;
    }
  }
  </code></pre>
  <p>I have to trying since 5 days ago, but I'm still getting this error..</p>
  <blockquote>
  <p>You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'table' at line 1.</p>
  </blockquote>
  <p>I still learn Java basicly. I have been to asked my software engineering teacher at school how to fix this problem, but we still can't fix it. I'm waiting for ur solution answer, thanks. :)</p>