|
This is the modified function in EJB:
public void updateTransinfo2 (String substaid, String lineid, String transid,
BigDecimal voltagein, Timestamp usedate,
String transname, String copyerid,
Integer transtypeid, Integer usetype,
Integer transcapa, Integer booknum,
String transaddr, String producecompany,
String producecode, Timestamp producedate,
Integer nousedays, Integer compoint,
BigDecimal rating) {
TransinfoPK pk = new TransinfoPK (substaid, lineid, transid);
try {
TransinfoRemote ejb = Transinfohome.findByPrimaryKey (pk);
ejb.setVoltagein (voltagein);
ejb.setUsedate (usedate);
ejb.setTransname (transname);
ejb.setCopyerid (copyerid);
ejb.setTranstypeid (transtypeid);
ejb.setUsetype (usetype);
ejb.setTranscapa (transcapa);
ejb.setTransaddr (transaddr);
ejb.setProducecompany (producecompany);
ejb.setProducecode (producecode);
ejb.setProducedate (producedate);
ejb.setNousedays (nousedays);
ejb.setCompoint (compoint);
ejb.setRating (rating);
ejb.setBooknum (booknum);
}
catch (RemoteException ex) {
}
catch (FinderException ex) {
}
}
This is the test terminal I generated in JBUILDER:
public static void main (String [] args) {
dyxxSessTestClient1 client = new dyxxSessTestClient1 ();
dyxxSess test = client.create ();
String substaid = "01"; // Substation number
String lineid = "3030"; // Line number
String transid = "005"; // Transformer ID
BigDecimal voltagein = new BigDecimal ("36.1"); // Input terminal voltage
Timestamp usedate = Timestamp.valueOf ("2015-11-11 15: 14: 18.999999911"); // Date of operation
String transname = "33"; // Transformer name
String copyerid = "01"; // Number of copy meter
String charcomid = "02"; // Number of power supply station
Integer transtypeid = Integer.valueOf (1); // Transformer type
Integer usetype = Integer.valueOf (0); // Special public flag
Integer transcapa = Integer.valueOf (33); // Fixed capacity
Integer booknum = Integer.valueOf (33); // Table number
String transaddr = "33"; // Installation address
String producecompany = "33"; // Manufacturer
String producecode = "33"; // Factory number
Timestamp producedate = Timestamp.valueOf ("2015-08-08 15: 14: 18.999999911"); // Date of manufacture
Integer nousedays = Integer.valueOf (33); // number of running days
Integer compoint = Integer.valueOf (0);
BigDecimal rating = new BigDecimal ("0.5555");
// BigDecimal rating = null;
try {
test.updateTransinfo2 (
substaid, lineid, transid,
voltagein, usedate,
transname, copyerid, transtypeid,
usetype, transcapa, booknum
, transaddr,
producecompany, producecode,
producedate, nousedays, compoint, rating
);
}
catch (Exception ex) {
ex.printStackTrace ();
}
}
When I commented out ejb.setBooknum (booknum) in EJB's public void updateTransinfo2 (..) {..}; there is no problem in running the entire test terminal, and the remaining fields can also be modified. If there is this sentence, the above error will be reported on the test side.
update transinfo set booknum = 999 where substaid = '01 'and lineid =' 3030 'and transid =' 001 '
This is when I change the field with the trigger separately in the query analyzer, the trigger can work normally
Also hope that masters enlighten me |
|