本文整理汇总了Java中com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException类的典型用法代码示例。如果您正苦于以下问题:Java MySQLIntegrityConstraintViolationException类的具体用法?Java MySQLIntegrityConstraintViolationException怎么用?Java MySQLIntegrityConstraintViolationException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MySQLIntegrityConstraintViolationException类属于com.mysql.jdbc.exceptions包,在下文中一共展示了MySQLIntegrityConstraintViolationException类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeRing
import com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException; //导入依赖的package包/类
public static int[] makeRing(int itemid, MapleCharacter partner1, MapleCharacter partner2) throws Exception {
int[] ringID = {MapleInventoryIdentifier.getInstance(), MapleInventoryIdentifier.getInstance()};
try {
addToDB(itemid, partner1, partner2.getName(), partner2.getId(), ringID);
} catch (MySQLIntegrityConstraintViolationException mslcve) {
return ringID;
}
return ringID;
}
示例2: makeRing
import com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException; //导入依赖的package包/类
public static int[] makeRing(int itemId, MapleCharacter player, MapleCharacter partnerPlayer)
throws Exception {
int[] makeRingId = {MapleInventoryIdentifier.getInstance(), MapleInventoryIdentifier.getInstance()};
try {
addToDB(itemId, player, partnerPlayer.getName(), partnerPlayer.getId(), makeRingId);
} catch (MySQLIntegrityConstraintViolationException mslcve) {
return makeRingId;
}
return makeRingId;
}