1 24 25 package org.objectweb.cjdbc.driver; 26 27 import java.sql.SQLException ; 28 29 36 public class Savepoint implements java.sql.Savepoint 37 { 38 private int savepointId; 39 40 private String savepointName; 41 42 47 public Savepoint(int savepointId) 48 { 49 this.savepointId = savepointId; 50 } 51 52 57 public Savepoint(String savepointName) 58 { 59 this.savepointName = savepointName; 60 } 61 62 65 public int getSavepointId() throws SQLException 66 { 67 if (this.savepointName != null) 68 throw new SQLException ("This is a named savepoint"); 69 70 return this.savepointId; 71 } 72 73 76 public String getSavepointName() throws SQLException 77 { 78 if (this.savepointName == null) 79 throw new SQLException ("This is an unnamed savepoint"); 80 81 return this.savepointName; 82 } 83 } 84 | Popular Tags |