VMware Cloud Community
dunnix
Contributor
Contributor

Simple MS SQL custom query plugin; What am I doing wrong?

Hello, I've been trying to create a simple SQL query plugin for Microsoft Sql Server 2000. I think I pretty much covered all the bases, though when I run I test it using the java command below, nothing happens.

here is my code:


jre\bin\java.exe -jar pdk\lib\hq-product.jar -Dplugins.include=ivrsql2 -m metric:


<plugin>
<service name="ivrsql2">



<!-- JDBC STUFF -->

<property name="jdbcUrl"
value="jdbc:sqlserver://192.168.4.10:1433;DatabaseName=IVR_QA"/>

<property name="jdbcDriver"
value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>

<property name="jdbcUser"
value="****"/>

<property name="jdbcPassword"
value="****"/>

<config include="sql"/>


<!-- SQL STUFF *should be fine* -->

<filter name="template" value="sql:${query}:${name}"/>
<filter name="count" value="SELECT COUNT(*) FROM"/>
<metric name="Availability"
query="SELECT COUNT(*) FROM info_stats WHERE 1=1"
indicator="true"/>


</service>
</plugin>


I am getting a blank line. No data on it. I know my query is correct since when I run the query in MS SQL, I get a number returned. Can anyone see a problem with it? Something i am missing maybe?
0 Kudos
1 Reply
TheChristoph
Contributor
Contributor

I'm not sure, but I declare my JDBC like that:

<config>
<!-- ietac Query -->
<option name="jdbcDriver" type="enum"
description="JDBC Driver Class Name">
<include name="oracle.jdbc.driver.OracleDriver"/>
<include name="org.postgresql.Driver"/>
<include name="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
</option>

<option name="jdbcUrl"
description="JDBC Connection URL"
default="jdbc:oracle:thin:@ip:port:db"/>

<option name="jdbcUser"
description="JDBC User"
default="username"/>

<option name="jdbcPassword"
type="secret"
optional="true"
description="JDBC Password"/>
</config>

Than SQL-Queries etc. ...

I think the <config include="sql"/> - Tag, loads the standard-JDBC Values and overwrites the values you declare before.

But, I'm not sure.
Tell us what the reason was, if you solve the problem.
0 Kudos