Sie sind auf Seite 1von 2

import java.sql.

*; public class helper { public static void main(String jj[]) { int st=0; int x=1; int l=0; int t=0; int h=40; int w=40; int rowmax=29; int colmnmax=35; int total=1015; int y=0; int row=1; int column=1; y=x; try { Class.forName("com.mysql.jdbc.Driver"); Connection connection=DriverManager.getConnection("jdbc:mysql://localhost:33 06/pixelscript","root","root"); PreparedStatement preparedStatement; preparedStatement=connection.prepareStatement("delete from block_table"); preparedStatement.executeUpdate(); preparedStatement.close(); PreparedStatement preparedStatement2=null; while(x<=total) { preparedStatement2=connection.prepareStatement("insert into block_table values(? ,?,?,?,?,?,?,?,?,?,?)"); preparedStatement2.setInt(1,x); preparedStatement2.setString(2,"empty"); preparedStatement2.setString(3,"logo.png"); preparedStatement2.setString(4,"logo.png"); preparedStatement2.setString(5,h+"px"); preparedStatement2.setString(6,w+"px"); preparedStatement2.setString(7,l+"px"); preparedStatement2.setString(8,t+"px"); preparedStatement2.setInt(9,row); preparedStatement2.setInt(10,column); preparedStatement2.setInt(11,st); preparedStatement2.executeUpdate(); System.out.print(" "+x); x++; column++; l=l+w; if(y==rowmax) { t=t+h; l=0; y=0; column=1; row++; } y++;

} connection.close(); }catch(Exception e) { System.out.println(e); } } }

Das könnte Ihnen auch gefallen