Please help me to resolve this null pointer exception.
I am executing this script from "Script Runner" console in JIRA.
--------------------------------------------------------------------------------------------------------------------------
this.class.classLoader.rootLoader.addURL(new URL("file:///C:/TEMP/sqljdbc4.jar"))
import groovy.sql.Sql
import java.sql.Driver
def sql = Sql.newInstance("jdbc:sqlserver://servername:1433/Valid_DB_Name", "Valid user", "valid password", "com.microsoft.sqlserver.jdbc.SQLServerDriver")
--------------------------------------------------------------------------------------------------------------------------
The first line of your code here calls a method on an object that does not exist at the point at which you run it. The "this" is empty!
Thanks, Nic.
Could you please help me further to resolve it? I am not much into OO programming and although I understood your point, however, couldn't able to think of the resolution as such.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can't tell you anything more - your code and explanation do not explain what the "this" object is for or where you expect it to come from
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.