home *** CD-ROM | disk | FTP | other *** search
- package symantec.itools.db.net;
-
- import java.io.DataInputStream;
- import java.io.DataOutputStream;
- import java.io.EOFException;
- import java.io.IOException;
- import symjava.sql.SQLException;
- import symjava.sql.SQLWarning;
-
- public class Warning extends ServerObject {
- String _message = new String("");
- String _SQLState = new String("");
- int _code = 0;
-
- Warning() {
- }
-
- public SQLWarning toSQLWarning() {
- return new SQLWarning(this._message, this._SQLState, this._code);
- }
-
- int getType() {
- return 88;
- }
-
- void read(DataInputStream var1) throws SQLException, IOException, ErrorException {
- var1.readShort();
- byte[] var2 = new byte[4];
- var1.readFully(var2, 0, 4);
- ServerObject var3 = (ServerObject)NetClass.getNextObject(var1);
- if (var3.getType() == 52) {
- this._message = ((NetString)var3).toString();
- } else {
- ((ServerObject)this).onObjectError(var3);
- }
-
- var3 = (ServerObject)NetClass.getNextObject(var1);
- if (var3.getType() == 52) {
- this._SQLState = ((NetString)var3).toString();
- } else {
- ((ServerObject)this).onObjectError(var3);
- }
-
- var3 = (ServerObject)NetClass.getNextObject(var1);
- if (var3.getType() == 51) {
- try {
- this._code = ((NetData)var3).getInt();
- } catch (EOFException var5) {
- throw new SQLException(((Throwable)var5).getMessage());
- }
- } else {
- ((ServerObject)this).onObjectError(var3);
- }
-
- var3 = (ServerObject)NetClass.getNextObject(var1);
- if (var3.getType() != 50) {
- ((ServerObject)this).onObjectError(var3);
- }
-
- }
-
- void write(DataOutputStream var1) throws IOException {
- var1.writeByte(this.getType());
- var1.writeShort(0);
- NetString var2 = new NetString(this._message);
- var2.write(var1);
- var2 = new NetString(this._SQLState);
- var2.write(var1);
- NetData var3 = new NetData(this._code);
- var3.write(var1);
- EOT var4 = new EOT();
- var4.write(var1);
- }
- }
-