Home > OS >  How to use parameters with Oracle JDBC?
How to use parameters with Oracle JDBC?

Time:10-29

I am using Oracles JDBC driver for 11g. And I want to establish the connection using the parameter defaultRowPrefetch=10000. When I try to call the connection URL, I get the following error:

Error trying to connect to 'jdbc:oracle:thin:@atukwos57:1521/LIVE;defaultRowPrefetch=10000':Invalid connection string format, a valid format is: "host:port:sid"  

I cant find any examples. Am I using it wrong? Leaving out the parameter establishes the connection.

enter image description here

CodePudding user response:

Try this one

jdbc:oracle:thin:@atukwos57:1521/LIVE?defaultRowPrefetch=10000

Syntax

jdbc:oracle:thin:@[[protocol:]//]
    host1[,host12,host13][:port1][,host2:port2]/service_name[:server][/instance_name]
    [?[parameter-name1=parameter-value1][&parameter-name2=parameter-value2],...]

CodePudding user response:

There is a file called oracle.jdbc\defaultConnectionProperties.properties in the jar-file. Adding oracle.jdbc.defaultRowPrefetch=10000 to this file solved the issue.

  • Related