Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DTP » Accessing table for MySQL database
Accessing table for MySQL database [message #593732] Sat, 08 November 2008 19:18
Eclipse UserFriend
Originally posted by:

Here is something I can't get my head around: I can configure my MySQL
database so that it shows up in the Data Source Explorer and I can
access the table(s).
If I want to check the structure of the table from some piece of code I
retrieve a Database object retrieve the schemas and grab the tables.
Since MySQL doesn't care about schemas I tried to grab the catalogs with
the same result. Here is the piece of code:

public List<String> getOwner(IConnectionProfile profile, String factoryID){
Vector<String> v = new Vector<String>();
if (factoryID==null){
IConnection conn = profile.createConnection(factoryID);
JDBCDatabase database = new JDBCDatabase((Connection)
EList l = database.getCatalogs();
for (Iterator iterator = l.iterator(); iterator.hasNext();) {
Catalog s = (Catalog);
return v;

Irrelevant of the fact that I use database.getCatalogs() or
database.getSchemas() the result is always an empty list.

Based on the fact that it is possible to retrieve the data I must miss
something. Or is there another way to gather the meta data of a table?

Hope someone can help me out

Previous Topic:EclipseCon 2009 is now open for submissions!
Next Topic:Accessing table for MySQL database
Goto Forum:

Current Time: Fri Jun 22 03:59:38 GMT 2018

Powered by FUDForum. Page generated in 0.01184 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top