node-jasper icon indicating copy to clipboard operation
node-jasper copied to clipboard

No support for Oracle database connectivity

Open rajeshcbe2000 opened this issue 2 years ago • 4 comments

Used following settings for Oracle connectivity, jasper = require('node-jasper')({ path: '../jasperreports-5.6.0', reports: { hw: { jasper: '../test.jasper'

		}
},
drivers: {
        oracle: {
            path: '../ojdbc6.jar',
			class: 'oracle.jdbc.OracleDriver',
            type: 'oracle'
        }
},
conns: {
        dbserver1: {
            host: 'hostname',
            port: 1521,
            dbname: 'db',
            user: 'user',
            pass: 'pwd',
			driver: {
				type: 'oracle:thin'
			}
        }
},
defaultConn: 'dbserver1'

});

But the following problem faced calling this 2nd time, please provide a solution for this.

Error: Error running instance method java.lang.AbstractMethodError: oracle.jdbc.driver.OracleConnection.isValid(I)Z at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483)

rajeshcbe2000 avatar Jun 08 '23 11:06 rajeshcbe2000

Try replace driver: { type: 'oracle:thin' }

with : driver: 'oracle'

Daybayzayd avatar Jun 11 '23 10:06 Daybayzayd

Try replace driver: { type: 'oracle:thin' }

with : driver: 'oracle'

Thank you for your reply, but after replacing the driver type as you said, I'm getting the following error. Please help me to resolve this issue.

Error: Error running static method java.sql.SQLException: Invalid Oracle URL specified at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:285) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:203) at java.sql.DriverManager.getConnection(DriverManager.java:664) at java.sql.DriverManager.getConnection(DriverManager.java:247) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483)

rajeshcbe2000 avatar Jun 12 '23 07:06 rajeshcbe2000

"Invalid Oracle URL specified"

As the message said, the url is incorrect.

You should replace the information in this code block with your url and credentials. dbserver1: { host: 'hostname', port: 1521, dbname: 'db', user: 'user', pass: 'pwd', }

You should replace the hostname by the host when your database is stored, replace the port, the name of the database (dbname) the user and the password with yours.

Maybe verify if : path: '../ojdbc6.jar', is correct and if you really have the file "ojdbc6.jar" in the location "../" ! ;)

Daybayzayd avatar Jun 12 '23 17:06 Daybayzayd

"Invalid Oracle URL specified"

As the message said, the url is incorrect.

You should replace the information in this code block with your url and credentials. dbserver1: { host: 'hostname', port: 1521, dbname: 'db', user: 'user', pass: 'pwd', }

You should replace the hostname by the host when your database is stored, replace the port, the name of the database (dbname) the user and the password with yours.

Maybe verify if : path: '../ojdbc6.jar', is correct and if you really have the file "ojdbc6.jar" in the location "../" ! ;)

Since I can't share all the information, I've just shared like that. Database is connecting if we give "driver: { type: 'oracle:thin' }", but only problem is DB not getting connected from 2nd time.

rajeshcbe2000 avatar Jun 15 '23 08:06 rajeshcbe2000