public int insert(String table, String[] cols, String[] vals) throws Throwable {
    	// one-table insert
    	String query = "";
    	int i = 0;
    	if (cols.length == vals.length) {
	    	for( String column: cols ) {
	    		query += "INSERT INTO "+table+"("+column+") VALUES("+vals[i]+");";
	    		i++;
	    	}
	    	sqlExecute(query);
	        ResultSet key = pst.getGeneratedKeys();
	    	return key.getInt(1);
    	} else {
    		return -1;
    	}
    }