Java tutorial
//package com.java2s; import java.sql.*; public class Main { public static final String CONTEXTUAL_LAYER_TYPE = "Contextual"; public static PreparedStatement createLayersInsertForContextual(Connection conn, int layerId, String description, String path, String name, String displayPath, double minLatitude, double minLongitude, double maxLatitude, double maxLongitude, String path_orig) throws SQLException { PreparedStatement stLayersInsert = conn.prepareStatement( "INSERT INTO layers (id, name, description, type, path, displayPath, minlatitude, minlongitude, maxlatitude, maxlongitude, enabled, displayname, uid, path_orig) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);"); stLayersInsert.setInt(1, layerId); stLayersInsert.setString(2, name); stLayersInsert.setString(3, description); stLayersInsert.setString(4, CONTEXTUAL_LAYER_TYPE); stLayersInsert.setString(5, path); stLayersInsert.setString(6, displayPath); stLayersInsert.setDouble(7, minLatitude); stLayersInsert.setDouble(8, minLongitude); stLayersInsert.setDouble(9, maxLatitude); stLayersInsert.setDouble(10, maxLongitude); stLayersInsert.setBoolean(11, true); stLayersInsert.setString(12, description); stLayersInsert.setString(13, Integer.toString(layerId)); stLayersInsert.setString(14, path_orig); return stLayersInsert; } }