On Sun, Mar 6, 2011 at 2:12 PM, Matthew Woodward <[email protected]>wrote:

> To put it another way this query might work fine directly in the MySQL
> console, but I bet it fails over JDBC no matter how you run it.
>

Interestingly this does work via JDBC from the command line:

import java.sql.*;

public class Foo {

  public static void main(String[] args) {
  Connection con = null;
  String url = "jdbc:mysql://localhost:3306/";
  String db = "foo";
  String driver = "com.mysql.jdbc.Driver";
  String user = "root";
  String password = "password";

  try {
Class.forName(driver).newInstance();
con = DriverManager.getConnection(url + db, user, password);
 Statement s = con.createStatement();
s.executeQuery("SHOW FULL Tables");
ResultSet rs = s.getResultSet();
 while (rs.next()) {
String tableName = rs.getString("Tables_in_foo");
String tableType = rs.getString("Table_type");
System.out.println("Table name: " + tableName + ", table type: " +
tableType);
}
 rs.close();
s.close();
  } catch (Exception e) {
System.out.println(e.toString());
  }
  }
}

Unfortunately at this point deciphering why it doesn't work in OpenBD is
beyond me. I'd have to fire things up in Eclipse with the OpenBD source and
run things in debug mode which I can do at some point, just probably not
today.

Maybe Alan or Andy will have some insight given the additional
troubleshooting, namely that it works with a stand-alone little Java app.
-- 
Matthew Woodward
[email protected]
http://blog.mattwoodward.com
identi.ca / Twitter: @mpwoodward

Please do not send me proprietary file formats such as Word, PowerPoint,
etc. as attachments.
http://www.gnu.org/philosophy/no-word-attachments.html

-- 
official tag/function reference: http://openbd.org/manual/
 mailing list - http://groups.google.com/group/openbd?hl=en

Reply via email to