java: DynaBean.contains(String name, String key) - how to use it properly?

I use List to fetch a ResultSet from an SQL query (using mysql). After I fetch one row using

DynaBean row = rowList.get(0); 

I would like to know if one of the columns named 'id' exists.

The problem is that the row.contains() function requires two parameters. String name and String key. I can't quite figure out how to use this function.

any ideas?

thanks!

Answers


Welp.. it's not the answer I wanted, but for now I can use the get() function to retrieve the rows and check using a try catch block and catching IllegalArgumentException which means that the column name is not available.

    List<DynaBean> rowsList=this._mysqlDb.foobar();
    Date timeStamp=null;
    for (int i=0;i<rowsList.size();i++) {
        DynaBean row = rowsList.get(i);
        try {
         timeStamp = this._mysqlDb.sqlTimestampToDate((java.sql.Timestamp)row.get("end_timestamp"));
        } catch (IllegalArgumentException e) {
            log.error("could not find properties: {}",e.getMessage());
            return false;
        }
}

Need Your Help

How can extract the module's name in a file?

prolog swi-prolog

How can extract the module's name and the optional predicates present in a file?

Using webdeploy to set ACL on a folder only if that folder exists

msbuild msdeploy webdeploy

I have a project that has a folder on the server which contains uploaded files. I don't include it in the web deploy because it's massive!

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.