title: Create and fill database from java
body: <p><strong>EDIT: I am using now preparedStatement with the following code:</strong></p>
  
  <pre><code>Statement st = con.createStatement();
  
  
          st.executeUpdate("CREATE TABLE IF NOT EXISTS Xbox_One (id INT AUTO_INCREMENT, "
                  + "PRIMARY KEY(id), Thumb VARCHAR (500), Juego VARCHAR(500), URL VARCHAR (200), Lanzamiento VARCHAR (50),Publicado VARCHAR (200), Descripcion TEXT(5000),"
                  + "Pegi VARCHAR(10), Descripcion_Pegi VARCHAR (200), nota FLOAT(10,1),"
                  + "USA VARCHAR (100), USA_Gold VARCHAR (100), USA_sin_Gold VARCHAR (100), USA_EA VARCHAR (100),"
                  + "ARG VARCHAR (100), ARG_Gold VARCHAR (100), ARG_sin_Gold VARCHAR (100), ARG_EA VARCHAR (100),"
                  + "AUS VARCHAR (100), AUS_Gold VARCHAR (100), AUS_sin_Gold VARCHAR (100), AUS_EA VARCHAR (100),"
                  + "BRA VARCHAR (100), BRA_Gold VARCHAR (100), BRA_sin_Gold VARCHAR (100), BRA_EA VARCHAR (100),"
                  + "CAN VARCHAR (100), CAN_Gold VARCHAR (100), CAN_sin_Gold VARCHAR (100), CAN_EA VARCHAR (100),"
                  + "SIN VARCHAR (100), SIN_Gold VARCHAR (100), SIN_sin_Gold VARCHAR (100), SIN_EA VARCHAR (100),"
                  + "ESP VARCHAR (100), ESP_Gold VARCHAR (100), ESP_sin_Gold VARCHAR (100), ESP_EA VARCHAR (100),"
                  + "HK VARCHAR (100), HK_Gold VARCHAR (100), HK_sin_Gold VARCHAR (100), HK_EA VARCHAR (100),"
                  + "MEX VARCHAR (100), MEX_Gold VARCHAR (100), MEX_sin_Gold VARCHAR (100), MEX_EA VARCHAR (100),"
                  + "COL VARCHAR (100), COL_Gold VARCHAR (100), COL_sin_Gold VARCHAR (100), COL_EA VARCHAR (100),"
                  + "HUN VARCHAR (100), HUN_Gold VARCHAR (100), HUN_sin_Gold VARCHAR (100), HUN_EA VARCHAR (100),"
                  + "SUD VARCHAR (100), SUD_Gold VARCHAR (100), SUD_sin_Gold VARCHAR (100), SUD_EA VARCHAR (100),"
                  + "RUS VARCHAR (100), RUS_Gold VARCHAR (100), RUS_sin_Gold VARCHAR (100), RUS_EA VARCHAR (100),"
                  + "CHI VARCHAR (100), CHI_Gold VARCHAR (100), CHI_sin_Gold VARCHAR (100), CHI_EA VARCHAR (100),"
                  + "CHINA VARCHAR (100), CHINA_Gold VARCHAR (100), CHINA_sin_Gold VARCHAR (100), CHINA_EA VARCHAR (100),"
                  + "IND VARCHAR (100), IND_Gold VARCHAR (100), IND_sin_Gold VARCHAR (100), IND_EA VARCHAR (100),"
                  + "JP VARCHAR (100), JP_Gold VARCHAR (100), JP_sin_Gold VARCHAR (100), JP_EA VARCHAR (100),"
                  + "KOR VARCHAR (100), KOR_Gold VARCHAR (100), KOR_sin_Gold VARCHAR (100), KOR_EA VARCHAR (100),"
                  + "TAI VARCHAR (100), TAI_Gold VARCHAR (100), TAI_sin_Gold VARCHAR (100), TAI_EA VARCHAR (100),"
                  + "UK VARCHAR (100), UK_Gold VARCHAR (100), UK_sin_Gold VARCHAR (100), UK_EA VARCHAR (100))"
                  );
  
  
  
  
          System.out.println( "Tabla creada!");
  
  
   PreparedStatement ps = con.prepareStatement("INSERT INTO Xbox_One (Juego, URL, Lanzamiento, Publicado, Descripcion, Pegi, Descripcion_Pegi, nota, "
                  + "USA, USA_Gold, USA_sin_Gold, USA_EA,"
                  + "ARG, ARG_Gold, ARG_sin_Gold, ARG_EA,"
                  + "AUS, AUS_Gold, AUS_sin_Gold, AUS_EA,"
                  + "BRA, BRA_Gold, BRA_sin_Gold, BRA_EA,"
                  + "CAN, CAN_Gold, CAN_sin_Gold, CAN_EA,"
                  + "SIN, SIN_Gold, SIN_sin_Gold, SIN_EA,"
                  + "ESP, ESP_Gold, ESP_sin_Gold, ESP_EA,"
                  + "HK, HK_Gold, HK_sin_Gold, HK_EA,"
                  + "MEX, MEX_Gold, MEX_sin_Gold, MEX_EA,"
                  + "COL, COL_Gold, COL_sin_Gold, COL_EA,"
                  + "HUN, HUN_Gold, HUN_sin_Gold, HUN_EA,"
                  + "SUD, SUD_Gold, SUD_sin_Gold, SUD_EA,"
                  + "RUS, RUS_Gold, RUS_sin_Gold, RUS_EA,"
                  + "CHI, CHI_Gold, CHI_sin_Gold, CHI_EA,"
                  + "CHINA, CHINA_Gold, CHINA_sin_Gold, CHINA_EA,"
                  + "IND, IND_Gold, IND_sin_Gold, IND_EA,"
                  + "JP, JP_Gold, JP_sin_Gold, JP_EA,"
                  + "KOR, KOR_Gold, KOR_sin_Gold, KOR_EA,"
                  + "TAI, TAI_Gold, TAI_sin_Gold, TAI_EA,"
                  + "UK, UK_Gold, UK_sin_Gold, UK_EA)"
                                  + ") VALUES (?,?,?,?,?,?,?,?"
                                  + ",?,?,?,?"
       + ",?,?,?,?"
       + ",?,?,?,?"
       + ",?,?,?,?"
       + ",?,?,?,?"
       + ",?,?,?,?"
       + ",?,?,?,?"
       + ",?,?,?,?"
       + ",?,?,?,?"
       + ",?,?,?,?"
       + ",?,?,?,?"
       + ",?,?,?,?"
       + ",?,?,?,?"
       + ",?,?,?,?"
       + ",?,?,?,?"
       + ",?,?,?,?"
       + ",?,?,?,?"
       + ",?,?,?,?"
       + ",?,?,?,?"
       + ",?,?,?,?"
                                  + ")");
  </code></pre>
  
  <p><strong>I receive the following error:</strong></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 ')VALUES ('Rocket League','rocket-league/c125w9bg2k0v','2016-02-17','Psyonix, In' at line 1"</p>
  </blockquote>
  
  <p><strong>If I try inserting the data manually I have problems too. As you can see the type is VARCHAR.</strong></p>
  
  <p><strong>Edit finished.</strong></p>
  
  <p>I am having problems with the code to introduce data from java to a table in Mysql.</p>
  
  <p>First I create the table if it doesn't exist:</p>
  
  <pre><code>            Statement st = con.createStatement();
  
  
          st.executeUpdate("CREATE TABLE IF NOT EXISTS Xbox_One (id INT AUTO_INCREMENT, "
                  + "PRIMARY KEY(id), Juego VARCHAR(500), URL VARCHAR (200), Lanzamiento VARCHAR (50), Descripcion TEXT(2000),"
                  + "Pegi VARCHAR(10), Descripcion_Pegi VARCHAR (200), nota FLOAT(10,1),"
                  + "USA VARCHAR (100), USA_Gold VARCHAR (100), USA_sin_Gold VARCHAR (100), USA_EA VARCHAR (100),"
                  + "ARG VARCHAR (100), ARG_Gold VARCHAR (100), ARG_sin_Gold VARCHAR (100), ARG_EA VARCHAR (100),"
                  + "AUS VARCHAR (100), AUS_Gold VARCHAR (100), AUS_sin_Gold VARCHAR (100), AUS_EA VARCHAR (100),"
                  + "BRA VARCHAR (100), BRA_Gold VARCHAR (100), BRA_sin_Gold VARCHAR (100), BRA_EA VARCHAR (100),"
                  + "CAN VARCHAR (100), CAN_Gold VARCHAR (100), CAN_sin_Gold VARCHAR (100), CAN_EA VARCHAR (100),"
                  + "SIN VARCHAR (100), SIN_Gold VARCHAR (100), SIN_sin_Gold VARCHAR (100), SIN_EA VARCHAR (100),"
                  + "ESP VARCHAR (100), ESP_Gold VARCHAR (100), ESP_sin_Gold VARCHAR (100), ESP_EA VARCHAR (100),"
                  + "HK VARCHAR (100), HK_Gold VARCHAR (100), HK_sin_Gold VARCHAR (100), HK_EA VARCHAR (100),"
                  + "MEX VARCHAR (100), MEX_Gold VARCHAR (100), MEX_sin_Gold VARCHAR (100), MEX_EA VARCHAR (100),"
                  + "COL VARCHAR (100), COL_Gold VARCHAR (100), COL_sin_Gold VARCHAR (100), COL_EA VARCHAR (100),"
                  + "HUN VARCHAR (100), HUN_Gold VARCHAR (100), HUN_sin_Gold VARCHAR (100), HUN_EA VARCHAR (100),"
                  + "SUD VARCHAR (100), SUD_Gold VARCHAR (100), SUD_sin_Gold VARCHAR (100), SUD_EA VARCHAR (100),"
                  + "RUS VARCHAR (100), RUS_Gold VARCHAR (100), RUS_sin_Gold VARCHAR (100), RUS_EA VARCHAR (100),"
                  + "CHI VARCHAR (100), CHI_Gold VARCHAR (100), CHI_sin_Gold VARCHAR (100), CHI_EA VARCHAR (100),"
                  + "IND VARCHAR (100), IND_Gold VARCHAR (100), IND_sin_Gold VARCHAR (100), IND_EA VARCHAR (100),"
                  + "JP VARCHAR (100), JP_Gold VARCHAR (100), JP_sin_Gold VARCHAR (100), JP_EA VARCHAR (100),"
                  + "KOR VARCHAR (100), KOR_Gold VARCHAR (100), KOR_sin_Gold VARCHAR (100), KOR_EA VARCHAR (100),"
                  + "TAI VARCHAR (100), TAI_Gold VARCHAR (100), TAI_sin_Gold VARCHAR (100), TAI_EA VARCHAR (100),"
                  + "UK VARCHAR (100), UK_Gold VARCHAR (100), UK_sin_Gold VARCHAR (100), UK_EA VARCHAR (100))"
                  );
  </code></pre>
  
  <p>This step is correct, the table is created. The problem is that I don't find the way to introduce the data, which is stored in a bidimensional array called listaEmpresaA. </p>
  
  <p>Here is the code I am using:</p>
  
  <pre><code>for (int i = 1; i&lt;listaEmpresaA.length; i++) { //la fila 1 es la del header que no nos interesa
                      for (int j=0; j&lt;1; j++) {
                          st.executeUpdate("INSERT INTO Xbox_One (Juego, URL, Publicado, Lanzamiento, Descripcion, Pegi, Descripcion_Pegi, nota, "
                                  + "USA, USA_Gold, USA_sin_Gold, USA_EA,"
                                  + "ARG, ARG_Gold, ARG_sin_Gold, ARG_EA,"
                                  + "AUS, AUS_Gold, AUS_sin_Gold, AUS_EA,"
                                  + "BRA, BRA_Gold, BRA_sin_Gold, BRA_EA,"
                                  + "CAN, CAN_Gold, CAN_sin_Gold, CAN_EA,"
                                  + "SIN, SIN_Gold, SIN_sin_Gold, SIN_EA,"
                                  + "ESP, ESP_Gold, ESP_sin_Gold, ESP_EA,"
                                  + "HK, HK_Gold, HK_sin_Gold, HK_EA,"
                                  + "MEX, MEX_Gold, MEX_sin_Gold, MEX_EA,"
                                  + "COL, COL_Gold, COL_sin_Gold, COL_EA,"
                                  + "HUN, HUN_Gold, HUN_sin_Gold, HUN_EA,"
                                  + "SUD, SUD_Gold, SUD_sin_Gold, SUD_EA,"
                                  + "RUS, RUS_Gold, RUS_sin_Gold, RUS_EA,"
                                  + "CHI, CHI_Gold, CHI_sin_Gold, CHI_EA,"
                                  + "CHINA, CHINA_Gold, CHINA_sin_Gold, CHINA_EA,"
                                  + "IND, IND_Gold, IND_sin_Gold, IND_EA,"
                                  + "JP, JP_Gold, JP_sin_Gold, JP_EA,"
                                  + "KOR, KOR_Gold, KOR_sin_Gold, KOR_EA,"
                                  + "TAI, TAI_Gold, TAI_sin_Gold, TAI_EA,"
                                  + "UK, UK_Gold, UK_sin_Gold, UK_EA)"
                                  + ") VALUES ('"
                                  +listaEmpresaA[i][j]+"','"+listaEmpresaA[i][j+1]+"','"+listaEmpresaA[i][j+2]+"', '"+listaEmpresaA[i][j+3]+"', '"+listaEmpresaA[i][j+4]+"', '"+listaEmpresaA[i][j+5]+"'"
                                  +listaEmpresaA[i][j+6]+"','"+listaEmpresaA[i][j+7]+"',"
                                  + "'"+listaEmpresaA[i][j+8]+"', '"+listaEmpresaA[i][j+9]+"'"                                        
                                  +listaEmpresaA[i][j+10]+"','"+listaEmpresaA[i][j+11]+"','"+listaEmpresaA[i][j+12]+"', '"+listaEmpresaA[i][j+13]+"'"
                                  +listaEmpresaA[i][j+14]+"','"+listaEmpresaA[i][j+15]+"','"+listaEmpresaA[i][j+16]+"', '"+listaEmpresaA[i][j+17]+"'"
                                  +listaEmpresaA[i][j+18]+"','"+listaEmpresaA[i][j+19]+"','"+listaEmpresaA[i][j+20]+"', '"+listaEmpresaA[i][j+21]+"'"
                                  +listaEmpresaA[i][j+22]+"','"+listaEmpresaA[i][j+23]+"','"+listaEmpresaA[i][j+24]+"', '"+listaEmpresaA[i][j+25]+"'"
                                  +listaEmpresaA[i][j+26]+"','"+listaEmpresaA[i][j+27]+"','"+listaEmpresaA[i][j+28]+"', '"+listaEmpresaA[i][j+29]+"'"
                                  +listaEmpresaA[i][j+30]+"','"+listaEmpresaA[i][j+31]+"','"+listaEmpresaA[i][j+32]+"', '"+listaEmpresaA[i][j+33]+"'"                                     
                                  +listaEmpresaA[i][j+34]+"','"+listaEmpresaA[i][j+35]+"','"+listaEmpresaA[i][j+36]+"', '"+listaEmpresaA[i][j+37]+"'"
                                  +listaEmpresaA[i][j+38]+"','"+listaEmpresaA[i][j+39]+"','"+listaEmpresaA[i][j+40]+"', '"+listaEmpresaA[i][j+41]+"'"
                                  +listaEmpresaA[i][j+42]+"','"+listaEmpresaA[i][j+43]+"','"+listaEmpresaA[i][j+44]+"', '"+listaEmpresaA[i][j+45]+"'"
                                  +listaEmpresaA[i][j+46]+"','"+listaEmpresaA[i][j+47]+"','"+listaEmpresaA[i][j+48]+"', '"+listaEmpresaA[i][j+49]+"'"
                                  +listaEmpresaA[i][j+50]+"','"+listaEmpresaA[i][j+51]+"','"+listaEmpresaA[i][j+52]+"', '"+listaEmpresaA[i][j+53]+"'"
                                  +listaEmpresaA[i][j+54]+"','"+listaEmpresaA[i][j+55]+"','"+listaEmpresaA[i][j+56]+"', '"+listaEmpresaA[i][j+57]+"'"
                                  +listaEmpresaA[i][j+58]+"','"+listaEmpresaA[i][j+59]+"','"+listaEmpresaA[i][j+60]+"', '"+listaEmpresaA[i][j+61]+"'"
                                  +listaEmpresaA[i][j+62]+"','"+listaEmpresaA[i][j+63]+"','"+listaEmpresaA[i][j+64]+"', '"+listaEmpresaA[i][j+65]+"'"
                                  +listaEmpresaA[i][j+66]+"','"+listaEmpresaA[i][j+67]+"','"+listaEmpresaA[i][j+68]+"', '"+listaEmpresaA[i][j+69]+"'"
                                  +listaEmpresaA[i][j+70]+"','"+listaEmpresaA[i][j+71]+"','"+listaEmpresaA[i][j+72]+"', '"+listaEmpresaA[i][j+73]+"'"                                     
                                  +listaEmpresaA[i][j+74]+"','"+listaEmpresaA[i][j+75]+"','"+listaEmpresaA[i][j+76]+"', '"+listaEmpresaA[i][j+77]+"'"
                                  +listaEmpresaA[i][j+78]+"','"+listaEmpresaA[i][j+79]+"','"+listaEmpresaA[i][j+80]+"', '"+listaEmpresaA[i][j+81]+"'"
                                  +listaEmpresaA[i][j+82]+"','"+listaEmpresaA[i][j+83]+"','"+listaEmpresaA[i][j+84]+"', '"+listaEmpresaA[i][j+85]+"'"
                                  +listaEmpresaA[i][j+86]+"','"+listaEmpresaA[i][j+87]+"','"+listaEmpresaA[i][j+88]+"', '"+listaEmpresaA[i][j+89]+"'"
                                  +listaEmpresaA[i][j+90]+"','"+listaEmpresaA[i][j+91]+"','"+listaEmpresaA[i][j+92]+"', '"+listaEmpresaA[i][j+93]+"'"
                                  +listaEmpresaA[i][j+94]+"','"+listaEmpresaA[i][j+95]+"'"        
                                  + ")");
                      }
                  }
  </code></pre>
  
  <p>Could be a little bit messy but I haven't found any other way to do it.</p>
  
  <p>I would appreciate if you could give me some tips or point at the error(s). There is no error in the execution. </p>
  
  <p>Thanks in advice.</p>