« Download | Home | Programmers guide »

Model JDBC databases

We have been working on some scripts that can give you an idea about how to work with Applied Models.

This class converts a jdbc database to a CWM model and is a good example of code generation (although reverse).

This script can be used to visual databases and it can easily be changed to suit different kinds of relational databases.

Usage:
This example requires that the following files are in the classpath: nsmdf.jar, com-appliedmodels-mdf-cwm1_0.jar, mysql-connector-java-3.0.17-ga-bin.jar (get it from MySQL).


JDBC2CWM j2c = new JDBC2CWM();
//Open the connection
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://127.0.0.1/db","dbuser","password");
//Generate the CWM model
CWMPackage cwmPackage = j2c.generateCWM(con);
//Write the results to a file
XMIWriter writer=((MDFOutermostPackage)cwmPackage).getXMIWriter("1.1"); writer.write((MDFOutermostPackage)cwmPackage, "dbmodelincwm.xml");
con.close();

Download JDBC2CWM.tar.gz

The Model Is the Program!

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Latest news

Help us get better!

20 Feb 2007
We want to make Applied Models even better and we need your opinion. We would appreciate if you could spend about 5 minutes on our user interface survey. It can be found here....
Read more »

New version out now!

14 Feb 2007
The new improved version of Applied Models 1.4 is now ready for download. The new version contains bug fixes and some changes in the user interface....
Read more »

Programmers guide

17 Nov 2006
Now you can find a programmers manual and API documentation under the support section. It exemplifies how you can access and work with Models....
Read more »