Here you can find the source of saveResourceInfoRecord(long resourceId, long propertyId, String propertyValue, String userId, PreparedStatement ps)
Parameter | Description |
---|---|
resourceId | the resource id being saved |
propertyId | the property id being saved |
propertyValue | the property value being saved |
userId | the user saving this record |
ps | the prepared statement for this insertion |
Parameter | Description |
---|---|
SQLException | if any error occurs in the underlying layer |
RuntimeException | if not exactly one record was saved |
private static void saveResourceInfoRecord(long resourceId, long propertyId, String propertyValue, String userId, PreparedStatement ps) throws SQLException, RuntimeException
//package com.java2s; import java.sql.PreparedStatement; import java.sql.SQLException; public class Main { /**/*from w w w . j a va 2 s . c o m*/ * Private helper method to save a resource info record. * * @param resourceId the resource id being saved * @param propertyId the property id being saved * @param propertyValue the property value being saved * @param userId the user saving this record * @param ps the prepared statement for this insertion * @throws SQLException if any error occurs in the underlying layer * @throws RuntimeException if not exactly one record was saved * * @since 1.2 */ private static void saveResourceInfoRecord(long resourceId, long propertyId, String propertyValue, String userId, PreparedStatement ps) throws SQLException, RuntimeException { int index = 1; ps.setLong(index++, resourceId); ps.setLong(index++, propertyId); ps.setString(index++, propertyValue); ps.setString(index++, userId); ps.setString(index++, userId); int nr = ps.executeUpdate(); if (nr != 1) { throw new RuntimeException("Could not create resource info record for id = " + propertyId); } } }