Java Code Examples for com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException

The following are top voted examples for showing how to use com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: Lucid2.0   File: MapleRing.java   Source Code and License 5 votes vote down vote up
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;
}
 
Example 2
Project: Lucid2.0   File: MapleRing.java   Source Code and License 5 votes vote down vote up
public static int makeRing(int itemid, MapleCharacter partner1, String partner2, int id2, String msg, int sn) throws Exception {
    int[] ringID = {MapleInventoryIdentifier.getInstance(), MapleInventoryIdentifier.getInstance()};
    try {
        addToDB(itemid, partner1, partner2, id2, ringID);
    } catch (MySQLIntegrityConstraintViolationException mslcve) {
        return 0;
    }
    MapleInventoryManipulator.addRing(partner1, itemid, ringID[1], sn, partner2);
    partner1.getCashInventory().gift(id2, partner1.getName(), msg, sn, ringID[0]);
    return 1;
}
 
Example 3
Project: Mushy   File: MapleRing.java   Source Code and License 5 votes vote down vote up
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;
}
 
Example 4
Project: Mushy   File: MapleRing.java   Source Code and License 5 votes vote down vote up
public static int makeRing(int itemid, MapleCharacter partner1, String partner2, int id2, String msg, int sn) throws Exception {
    int[] ringID = {MapleInventoryIdentifier.getInstance(), MapleInventoryIdentifier.getInstance()};
    try {
        addToDB(itemid, partner1, partner2, id2, ringID);
    } catch (MySQLIntegrityConstraintViolationException mslcve) {
        return 0;
    }
    MapleInventoryManipulator.addRing(partner1, itemid, ringID[1], sn, partner2);
    partner1.getCashInventory().gift(id2, partner1.getName(), msg, sn, ringID[0]);
    return 1;
}
 
Example 5
Project: mapleLemon   File: MapleRing.java   Source Code and License 5 votes vote down vote up
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;
}
 
Example 6
Project: mapleLemon   File: MapleRing.java   Source Code and License 5 votes vote down vote up
public static int makeRing(int itemId, MapleCharacter player, String partnerName, int partnerId, String msg, int itemSn) throws Exception {
    int[] makeRingId = {MapleInventoryIdentifier.getInstance(), MapleInventoryIdentifier.getInstance()};
    try {
        addToDB(itemId, player, partnerName, partnerId, makeRingId);
    } catch (MySQLIntegrityConstraintViolationException mslcve) {
        return 0;
    }
    MapleInventoryManipulator.addRing(player, itemId, makeRingId[1], itemSn);
    player.getCashInventory().gift(partnerId, player.getName(), msg, itemSn, makeRingId[0]);
    return 1;
}
 
Example 7
Project: Asteria   File: MapleRing.java   Source Code and License 5 votes vote down vote up
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;
}
 
Example 8
Project: Asteria   File: MapleRing.java   Source Code and License 5 votes vote down vote up
public static int makeRing(int itemid, MapleCharacter partner1, String partner2, int id2, String msg, int sn) throws Exception {
    int[] ringID = {MapleInventoryIdentifier.getInstance(), MapleInventoryIdentifier.getInstance()};
    try {
        addToDB(itemid, partner1, partner2, id2, ringID);
    } catch (MySQLIntegrityConstraintViolationException mslcve) {
        return 0;
    }
    MapleInventoryManipulator.addRing(partner1, itemid, ringID[1], sn, partner2);
    partner1.getCashInventory().gift(id2, partner1.getName(), msg, sn, ringID[0]);
    return 1;
}