|
Oracle® Spatial Java API Reference 11g Release 1 (11.1) B28401-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.spatial.util.Util
public class Util
some useful utility routines used by SDOVIS. These are not clearly documented so use at your own risk!!
Constructor Summary | |
---|---|
Util() |
Method Summary | |
---|---|
static void |
center(java.awt.Component c) Centers an awt component w.r.t. |
static java.sql.Connection |
connect(java.lang.String host, java.lang.String sid, java.lang.String port, java.lang.String user, java.lang.String passwd, java.lang.String mode, int rowPref) Establishes an Oracle JDBC connection to the specified database. |
static double[] |
convert(java.lang.String str) Converts a string of coordinates into a double array. |
static java.lang.String |
getConnStr(java.lang.String mode, java.lang.String host, java.lang.String port, java.lang.String sid) connects to the database using supplied information. |
static java.lang.String |
getDBVersion(java.sql.Connection conn) Gets the version of the database connected. |
static java.lang.String |
getJDBCDriverVersion(java.sql.Connection conn) Gets the oracle JDBC driver version string. |
static java.awt.Shape |
getShape(double[] coords, boolean close) converts the coordinate array into a GeneralPath shape. |
static boolean |
isGeodetic(int srid) Using an Oracle convention to determin if a srid is geodetic |
static boolean |
isPre9i(java.sql.Connection conn) Determin if a database is pre-9i version. |
static void |
main(java.lang.String[] args) |
static java.awt.geom.Rectangle2D.Double |
mbr(double[] coords) |
static byte[] |
readFile(java.lang.String f) |
static java.util.ArrayList |
splitBy(java.lang.String str, java.lang.String delim) gets an array list of strings that are separated by delimiters such as commas |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Util()
Method Detail |
---|
public static double[] convert(java.lang.String str)
public static java.util.ArrayList splitBy(java.lang.String str, java.lang.String delim)
str
- the input string to be tokenizeddelim
- the delimiter to be used in tokenizing the stringan
- arrary list of all the tokenspublic static java.awt.Shape getShape(double[] coords, boolean close)
public static java.awt.geom.Rectangle2D.Double mbr(double[] coords)
public static byte[] readFile(java.lang.String f) throws java.io.IOException
java.io.IOException
public static java.sql.Connection connect(java.lang.String host, java.lang.String sid, java.lang.String port, java.lang.String user, java.lang.String passwd, java.lang.String mode, int rowPref)
host
- name of the host machine where the database runssid
- instance id of the databaseport
- which port the database is listening atuser
- the database user to connect topasswd
- the database user's passwordmode
- the connection mode; possible values are "thin", "oci" or "oci8". If null value is supplied the default "oci8" mode is attempted.rowPref
- the row prefetch to be set with the connection. If a value less than or equal to zero is supplied, the defualt value of 32 will be used for this connection.public static java.lang.String getJDBCDriverVersion(java.sql.Connection conn)
public static java.lang.String getDBVersion(java.sql.Connection conn)
public static boolean isPre9i(java.sql.Connection conn)
public static boolean isGeodetic(int srid)
public static java.lang.String getConnStr(java.lang.String mode, java.lang.String host, java.lang.String port, java.lang.String sid)
If user requires OCI-mode connection but failed, then a "Thin" mode connection is automatically attempted.mode
,host
,port
,sid
mode
- the mode of connection. It could either be a THIN or an OCI connection. THIN is slower but pure java, while OCI is faster but requires Oracle OCI library.host
- the host where the database is located.port
- the port where the database instance listens (default is 1521)sid
- the instance id of the database.user
- the user to login onpasswd
- the password of the userrowPref
- the row prefetch to be set with the connectionpublic static void center(java.awt.Component c)
public static void main(java.lang.String[] args) throws java.io.IOException, java.lang.Exception, java.sql.SQLException
java.io.IOException
java.lang.Exception
java.sql.SQLException
|
Oracle® Spatial Java API Reference 11g Release 1 (11.1) B28401-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |