|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.sahits.codegen.java.input.db.DBConnection
ch.sahits.codegen.java.input.db.MySQLConnection
ch.sahits.codegen.java.input.db.MySQLConnectionModelGenerator
public final class MySQLConnectionModelGenerator
This class can generate a model from a connection to a MySQL database.
| Field Summary |
|---|
| Fields inherited from class ch.sahits.codegen.java.input.db.DBConnection |
|---|
conn, db, host, password, port, product, schema, table, user |
| Constructor Summary | |
|---|---|
MySQLConnectionModelGenerator()
Default constructor |
|
| Method Summary | |
|---|---|
DataBaseTable |
generateModel()
Generate the database model |
java.lang.String |
getDefaultHost()
Retrieve the default name of the database host |
java.lang.String |
getDefaultPort()
Retrieve the default port number of the data base |
java.lang.String |
getDefaultUserName()
Retrieve the default user name for the data base |
int |
getRating()
This method rates the implementation. |
int |
getWorkload()
Defines how complex the generation of the model is. |
boolean |
hasSchema()
Indicates if this database works through schemas |
void |
init(java.lang.String hostname,
java.lang.String uname,
java.lang.String pwd,
java.lang.String database,
java.lang.String tablename,
int port,
java.lang.String schema)
Initialize the generator by calling init(String, String, String, String, String, String, String, int, String)
and passing an empty class and package name |
void |
init(java.lang.String hostname,
java.lang.String uname,
java.lang.String pwd,
java.lang.String database,
java.lang.String tablename,
java.lang.String packageName,
java.lang.String className,
int _port,
java.lang.String _schema)
Initializes the connection data |
void |
setDatabase(java.lang.String dbName)
Set the name of the database |
java.lang.String |
testConnection()
Test the connection to the database. |
| Methods inherited from class ch.sahits.codegen.java.input.db.MySQLConnection |
|---|
convert2Java, convert2JavaType, createDataBaseTable, getConnectionDriverClass, getConnectionString, getConstraintFieldSQL, getIndexConstraintSQL, getTableSQL, loadDriver |
| Methods inherited from class ch.sahits.codegen.java.input.db.DBConnection |
|---|
addFields2Index, getConstraintsFields, getPort, getSchema, getStructure, init, isAutGenKey, setHost, setPassword, setPort, setProduct, setSchema, setTableName, setUserName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface ch.sahits.codegen.model.IBasicDBConnectionModelGenerator |
|---|
getConnectionDriverClass, getConnectionString, setHost, setPassword, setPort, setTableName, setUserName |
| Constructor Detail |
|---|
public MySQLConnectionModelGenerator()
| Method Detail |
|---|
public void init(java.lang.String hostname,
java.lang.String uname,
java.lang.String pwd,
java.lang.String database,
java.lang.String tablename,
java.lang.String packageName,
java.lang.String className,
int _port,
java.lang.String _schema)
throws java.sql.SQLException
init in interface IDBConnectionModelGeneratorhostname - of the db eg. localhostuname - user name to connect to the DBpwd - password of the userdatabase - or schema of the tabletablename - table namepackageName - name of the packageclassName - name of the class_port - number_schema - name
java.sql.SQLException - Connecting failed probably due to incorrect inputpublic DataBaseTable generateModel()
generateModel in interface IBasicDBConnectionModelGeneratorpublic void setDatabase(java.lang.String dbName)
setDatabase in interface IBasicDBConnectionModelGeneratordbName - database namepublic java.lang.String testConnection()
testConnection in interface IBasicDBConnectionModelGeneratorpublic java.lang.String getDefaultHost()
getDefaultHost in interface IBasicDBConnectionModelGeneratorpublic java.lang.String getDefaultPort()
getDefaultPort in interface IBasicDBConnectionModelGeneratorpublic java.lang.String getDefaultUserName()
getDefaultUserName in interface IBasicDBConnectionModelGeneratorpublic int getRating()
getRating in interface IBasicDBConnectionModelGeneratorpublic int getWorkload()
getWorkload in interface IBasicDBConnectionModelGeneratorpublic boolean hasSchema()
hasSchema in interface IBasicDBConnectionModelGenerator
public void init(java.lang.String hostname,
java.lang.String uname,
java.lang.String pwd,
java.lang.String database,
java.lang.String tablename,
int port,
java.lang.String schema)
throws java.sql.SQLException
init(String, String, String, String, String, String, String, int, String)
and passing an empty class and package name
init in interface IGeneralDBConnectionModelGeneratorhostname - of the db eg. localhostuname - user name to connect to the DBpwd - password of the userdatabase - or schema of the tabletablename - table nameschema - Schema nameport - number
java.sql.SQLException - Connecting failed probably due to incorrect input
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||