I can advice you just to check whether the required methods work in pure java, i.e. write an simple java cli-app, that checks available tables and databases. Here is a small snapshots of java-code, that queries for DB-meta information using JDBC.
import java.sql.Connection;
import javax.sql.DataSource;
import org.apache.commons.dbcp.BasicDataSource;
private static DataSource getDataSource(){
String login = "root", pwd = "kne";
String url = "jdbc:mysql://localhost:3306/test";
BasicDataSource ds = new BasicDataSource();
ds.setDriverClassName("com.mysql.jdbc.Driver");
ds.setUsername(login);
ds.setPassword(pwd);
ds.setUrl(url);
return ds;
}
private static Object show(ResultSet rs, String title) throws Exce
+ption{
Object r = null;
System.out.println("[showing " + title + "]");
ResultSetMetaData rsmd = rs.getMetaData();
while(rs.next()){
for(int c = 1; c <= rsmd.getColumnCount(); c++){
String name = rsmd.getColumnName(c);
Object value = rs.getObject(c);
System.out.println(name + " : " + value);
if(r == null){
r = value;
}
}
}
System.out.println();
return r;
}
public static void main(String[] args) throws Exception{
DataSource ds = getDataSource();
Connection con = ds.getConnection();
DatabaseMetaData dbMetaData = con.getMetaData();
ResultSet catalogs = dbMetaData.getCatalogs();
String catalog = (String)show(catalogs, "catalogs");
ResultSet schemas = dbMetaData.getSchemas();
String schema = (String)show(schemas, "schemas");
ResultSet tables = dbMetaData.getTables("test", null, "", null
+);
show(tables, "tables");
System.out.println("ok");
}
So, you should validate, that JDBC driver you provide, actually works, and supports metainformation retrieval. As altenative you can download SQuirrelSQL, attach your jdbc-drivers for Phoenix,
and check, that it actually works.
So, it might be, that HBase or Phoenix, or JDBC driver does not support some operations. Only after assertion of that, you should look at perl's DBD::JDBC
PS. Too much bridges/layers!
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.