Code example for PreparedStatement

Methods: executeUpdatesetBigDecimalsetString

0
    public void run() { 
	Connection conn = connectionFactory.getConnection();
	try { 
	    PreparedStatement ins = conn
		    .prepareStatement("insert into PRICES(TICKER, PRICE_TYPE, PRICE) values(?,?,?)");
	    ins.setString(1, quote.getTicker());
	    ins.setString(2, quote.getType().name());
	    ins.setBigDecimal(3, quote.getPrice());
 
	    conn.setAutoCommit(true);
	    ins.executeUpdate();
	    conn.setAutoCommit(false);
	    connectionFactory.release(conn);
 
	} catch (SQLException e) {
	    // TODO Auto-generated catch block 
	    e.printStackTrace();
	} 
 
    } 
Connect your IDE to all the code out there  Get Codota for Java