|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.altair.hwm.database.dbmodel.HWMDatabaseInfo
public class HWMDatabaseInfo
Title: HWMDatabaseInfo
Description: This class will be implemented by classes that represent a particular database. This interface can be used to retrieve the types supported by a database and also the syntax
Company: Altair Engineering, Inc.
| Field Summary | |
|---|---|
static java.lang.String |
AUTO_ID_TYPE
The type for auto id |
static java.lang.String |
DBTYPE_ALTAIRQED
|
static java.lang.String |
DBTYPE_MYSQL
|
static java.lang.String |
DBTYPE_QED
The type of database |
static java.lang.String |
TYPE_BLOB
The type for blob |
static java.lang.String |
TYPE_BOOL
The type for bool |
static java.lang.String |
TYPE_CHAR
The type for char |
static java.lang.String |
TYPE_CLOB
The type for clob |
static java.lang.String |
TYPE_DATE
The type for date |
static java.lang.String |
TYPE_DOUBLE
The type for double |
static java.lang.String |
TYPE_FLOAT
The type for float |
static java.lang.String |
TYPE_INT
The type for Integer |
static java.lang.String |
TYPE_LONG
The type for long |
static java.lang.String |
TYPE_SHORT
The type for short |
static java.lang.String |
TYPE_STRING
The type for string |
| Constructor Summary | |
|---|---|
HWMDatabaseInfo()
|
|
| Method Summary | |
|---|---|
java.sql.Connection |
ConnectToDB(java.lang.String strURL,
int nPort,
java.lang.String strDBName,
java.lang.String strUser,
java.lang.String strPwd,
boolean bCreate)
Returns a connection to the given database. |
java.lang.String |
GetAutoInc()
Returns the SQL syntax for auto increment |
java.lang.String |
GetDriver()
Returns the driver name |
java.lang.String |
GetDriverID()
Returns the driver ID for the database. |
java.util.Hashtable |
GetTypeMapping()
Returns the hashtable that maps the datamodel's generic types to data types supported by the database |
static java.lang.String[] |
GetTypes()
Returns the types that the data model supports |
int |
InsertData(java.sql.Connection cxn,
java.sql.PreparedStatement prepStmt,
java.lang.String strClassName)
Insert data and retrieve the auto generated ID |
int |
RetrieveAutoInc(java.sql.Statement stmt)
Returns the auto inc ID |
int |
RetrieveAutoInc(java.sql.Statement stmt,
java.lang.String strTable)
Returns the auto inc ID |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String AUTO_ID_TYPE
public static final java.lang.String TYPE_BLOB
public static final java.lang.String TYPE_INT
public static final java.lang.String TYPE_FLOAT
public static final java.lang.String TYPE_DOUBLE
public static final java.lang.String TYPE_LONG
public static final java.lang.String TYPE_DATE
public static final java.lang.String TYPE_SHORT
public static final java.lang.String TYPE_CLOB
public static final java.lang.String TYPE_BOOL
public static final java.lang.String TYPE_STRING
public static final java.lang.String TYPE_CHAR
public static final java.lang.String DBTYPE_QED
public static final java.lang.String DBTYPE_MYSQL
public static final java.lang.String DBTYPE_ALTAIRQED
| Constructor Detail |
|---|
public HWMDatabaseInfo()
| Method Detail |
|---|
public static java.lang.String[] GetTypes()
public java.util.Hashtable GetTypeMapping()
public java.lang.String GetAutoInc()
public int InsertData(java.sql.Connection cxn,
java.sql.PreparedStatement prepStmt,
java.lang.String strClassName)
throws java.lang.Exception
cxn - Connection to the database.prepStmt - The statement to execute. The same statement object is
used to retrieve the auto incremented IDstrClassName - The class name into which data is being inserted
java.lang.Exception
public int RetrieveAutoInc(java.sql.Statement stmt)
throws java.lang.Exception
stmt - The statement object
java.lang.Exception
public int RetrieveAutoInc(java.sql.Statement stmt,
java.lang.String strTable)
throws java.lang.Exception
stmt - The statement objectstrTable - The table to retrieve the auto inc from
java.lang.Exceptionpublic java.lang.String GetDriver()
public java.sql.Connection ConnectToDB(java.lang.String strURL,
int nPort,
java.lang.String strDBName,
java.lang.String strUser,
java.lang.String strPwd,
boolean bCreate)
throws java.lang.Exception
strURL - The URL to connect/create the DBnPort - The port to which to connect to. If -1 then it
is ignoredstrDBName - The database name o connect to.strUser - The user namestrPwd - The password for the userbCreate - If true, the DB get the init packet for DB
creation else DB connection.
java.lang.Exceptionpublic java.lang.String GetDriverID()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||