Java 无法从web服务方法的try-catch块访问参数

Java 无法从web服务方法的try-catch块访问参数,java,web-services,netbeans-7,fingerprint,Java,Web Services,Netbeans 7,Fingerprint,我正在编写一个SOAPWeb服务方法,用java中的数字角色sdk将模板与功能集进行比较。我需要检索数据库中的字符串模板,然后将其转换为字节数组,以便与功能集进行匹配。我的web方法的输入参数是email和ftSet,它们都是字符串。Ftset还需要转换成字节数组,这些都是在try-catch块之后完成的。如何访问名为“dbTemplate”的变量 在声明连接对象后声明dbTemplate。在代码中,dbTemplate在try块中声明,因此try块之后的任何内容都不知道它的含义 Connect

我正在编写一个SOAPWeb服务方法,用java中的数字角色sdk将模板与功能集进行比较。我需要检索数据库中的字符串模板,然后将其转换为字节数组,以便与功能集进行匹配。我的web方法的输入参数是email和ftSet,它们都是字符串。Ftset还需要转换成字节数组,这些都是在try-catch块之后完成的。如何访问名为“dbTemplate”的变量


在声明连接对象后声明dbTemplate。在代码中,dbTemplate在try块中声明,因此try块之后的任何内容都不知道它的含义

Connection con = null;
String dbTemplate = null;
除了这个“if”块之外,没有人知道dbTemplate是什么

if (result.next()) { //.next() returns true if there is a next row returned by the query.
    String dbTemplate = result.getString("template");
}

好的,非常感谢。但我现在又犯了一个错误。它不归还任何东西。给我错误:(不是返回指纹已验证或未验证,而是获取此错误:服务调用引发异常,消息为null;请参阅服务器日志了解更多详细信息异常详细信息:java.lang.reflect.InvocationTargetException
if (result.next()) { //.next() returns true if there is a next row returned by the query.
    String dbTemplate = result.getString("template");
}