Search results
28 cze 2009 · Connect using the Oracle JDBC driver (oracle.jdbc.pool.OracleDataSource): String url = "jdbc:oracle:thin:@tcp://my-host:1522/my-service"; OracleDataSource ods = new OracleDataSource(); ods.setUser(userName); ods.setPassword(password); ods.setURL(url); Connection con = ods.getConnection();
Use the setConnectionProperties method to set the properties of the connection and the setConnectionCacheProperties method to set the properties of the connection cache.. If you are using the server-side internal driver, that is, the driverType property is set to kprb, then any other property settings are ignored.. If you are using the JDBC Thin or OCI driver, then note the following:
We can also include tnsnames.ora entries in the JDBC URL to connect to Oracle databases: jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<host>)(PORT=<port>))(CONNECT_DATA=(SERVICE_NAME=<service>))) Let’s see how to connect to our “my_servicename” service using entries from the tnsnames.ora file:
22 sty 2013 · Specifying a Database URL and Properties Object. The following signature takes a URL, together with a properties object that specifies user name and password (perhaps among other things): getConnection(String URL, Properties info); Where the URL is of the form: jdbc:oracle:<drivertype>:@<database>
6 lis 2024 · The JDBC Driver Connection URL strings for the most common relattional database systems: Oracle, SQL Server, PostgreSQL, MySQL, MariaDB, DB2, HSQLDB, H2,
2 mar 2022 · For reference, this article provides a summary of JDBC’s database connection URLs for the most common databases including MySQL, SQL Server, Oracle, PostgreSQL, Apache Derby (Java DB), SQLite and H2. jdbc:mysql:// [host] [,failoverhost...] [:port]/ [database] [?propertyName1] [=propertyValue1] [&propertyName2] [=propertyValue2]...
Oracle JDBC Thin Driver supports the following URL formats to establish a connection with an Oracle Database. Use any of the below format to establish connection to the Oracle Database. As the name suggests the EZConnect URL is the easiest option to connect to Oracle. host1[,host12,host13][:port1][,host2:port2]/service_name[:server][/instance_name]