In order to connect to an oracle database via JDBC the oracle
listener must be running on the database server. Thats correct isn't
it?
|
|
0
|
|
|
|
Reply
|
jldunn2000797 (48)
|
1/9/2009 6:37:42 PM |
|
On Jan 9, 12:37=A0pm, Loial <jldunn2...@googlemail.com> wrote:
> In order to connect to an oracle database via JDBC =A0the oracle
> listener must be running on the database server. =A0Thats correct isn't
> it?
Yes.
David Fitzjarrell
|
|
0
|
|
|
|
Reply
|
oratune (495)
|
1/9/2009 7:15:15 PM
|
|
On Jan 9, 1:37=A0pm, Loial <jldunn2...@googlemail.com> wrote:
> In order to connect to an oracle database via JDBC =A0the oracle
> listener must be running on the database server. =A0Thats correct isn't
> it?
On Jan 9, 1:37 pm, Loial <jldunn2...@googlemail.com> wrote:
> In order to connect to an oracle database via JDBC the oracle
> listener must be running on the database server. Thats correct isn't
> it?
The only two cases where you would *not* need a listrener is:
* If you are running the JVM inside the database (kprb driver), or
* If you are using OCI and connecting on the database server itself
with your ORACLE_SID set in your environment. i.e.,
C:\java>type local.java
import java.sql.*;
public class local {
public static void main(String args[]) {
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn =3D DriverManager.getConnection
("jdbc:oracle:oci:@","system"
,"fake_pwd");
conn.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
}
C:\java>javac local.java
C:\java>set oracle_sid=3Dtst11g
C:\java>set oracle_sid=3Dorcl11g
C:\java>java local
java.sql.SQLException: ORA-01017: invalid username/password; logon
denied
at oracle.jdbc.driver.SQLStateMapping.newSQLException
(SQLStateMapping.ja
va:70)
at oracle.jdbc.driver.DatabaseError.newSQLException
(DatabaseError.java:1
10)
at oracle.jdbc.driver.DatabaseError.throwSqlException
(DatabaseError.java
:171)
at oracle.jdbc.driver.T2CConnection.checkError
(T2CConnection.java:686)
at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:
338)
at oracle.jdbc.driver.PhysicalConnection.<init>
(PhysicalConnection.java:
490)
at oracle.jdbc.driver.T2CConnection.<init>(T2CConnection.java:
133)
at oracle.jdbc.driver.T2CDriverExtension.getConnection
(T2CDriverExtensio
n.java:53)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:
465)
at java.sql.DriverManager.getConnection(DriverManager.java:
582)
at java.sql.DriverManager.getConnection(DriverManager.java:
185)
at local.main(local.java:7)
C:\java>
|
|
0
|
|
|
|
Reply
|
stevedhoward (759)
|
1/9/2009 7:35:34 PM
|
|