Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: DBD::JDBC craziness

by basiliscos (Monk)
on Apr 05, 2014 at 11:46 UTC ( #1081235=note: print w/ replies, xml ) Need Help??

in reply to DBD::JDBC craziness

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({ 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!

Comment on Re: DBD::JDBC craziness
Download Code
Re^2: DBD::JDBC craziness
by spragues (Initiate) on Apr 08, 2014 at 19:29 UTC

    thank you. for sure the phoenix jar file provides the getMetaData method. And like you say just way too many layers going on here.

    so i guess that begs the question. if a jdbc driver exists how does one go about actually writing a legitimate perl driver that leverages it, say in this case, DBD::Phoenix?

    something tells me - PUNT! :(

    thanks again for responding!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1081235]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2014-12-25 08:49 GMT
Find Nodes?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?

    Results (159 votes), past polls