Ciao a tutti io ho questo codice
conn.setAutoCommit(false); //1 2 3 4 5 6 7 8 9 10 11 1 2 3 4 5 6 7 8 9 10 11
PreparedStatement pstmt = conn.prepareStatement("insert into storico(IMEI,Lat,Lng,Alt,Data,Speed,Direction,Gps,pos15,Istp,Vbat) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); // QUERY INSERT
// leggi dati
while (null != (mes = in.readLine())) {
StringTokenizer st = new StringTokenizer(mes, ";");
String token = null;
int i = 1;
while((token = st.nextToken())!=null) {
pstmt.setString(i++, token);
System.out.println(token);
}
pstmt.executeUpdate();
}
conn.commit();
Ho fatto il debug e fino alla stampa tokenizzata della stringa tutto ok, ma quando faccio pstmt.executeUpdate(); genera questo erroro sapreste aiutarmi??? non so piu che fare.
java.util.NoSuchElementException
at java.util.StringTokenizer.nextToken(Unknown Source)
at Prove.ServerTcpAlpha.run(ServerTcpAlpha.java:123)
:'( :'( :'( :'(