📄 address.java
字号:
import java.sql.*;import oracle.sql.*;public class Address implements ORAData, ORADataFactory{ static final Address _factory = new Address (); String sql_type = "SCOTT.ADDRESS_T"; public String street; public String city; public String state; public int zipCode; public static ORADataFactory getFactory() { return _factory; } public Address () {} public Address (String street, String city, String state, int zipCode) { this.street = street; this.city = city; this.state = state; this.zipCode = zipCode; } public Datum toDatum(Connection c) throws SQLException { StructDescriptor sd = StructDescriptor.createDescriptor(sql_type, c); Object [] attributes = { street, city, state, new Integer(zipCode) }; return new STRUCT(sd, c, attributes); } public ORAData create(Datum d, int sqlType) throws SQLException { if (d == null) return null; Datum[] attributes = ((JAVA_STRUCT) d).getOracleAttributes(); return new Address (attributes[0].stringValue (), attributes[1].stringValue (), attributes[2].stringValue (), attributes[3].intValue ()); } public String toString () { return sql_type+" : "+street+", "+city+", "+state+", "+zipCode; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -