0

Hi,

I was a beginner in java.I was trying to connect to database(oracle) with the deatails

user:scott pass:tiger host string: PC0128166 with code as

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
     
connection =DriverManager.getConnection("jdbc:odbc:abhi","scott","tiger");

But i was getting the error as

Exception is ;java.sql.SQLException: [Microsoft][ODBC driver for Oracle][Oracle]ORA-12560: TNS:protocol adapter error

problem is the same error i was getting when i was logging into oracle from oracle console uname:scott
pass:tiger and host string as empty.
so i want to know how to connect to database using host string in jdbc connection

3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by jwenting
0

Did u mean using jdbc 4th type driver.

If so means please help me by telling the

syntax of that driver

1

read the product documentation for the Oracle JDBC driver. It'll tell you how to connect.

And please don't do this from a JSP. JSP aren't meant for doing business logic, and should never contain Java code.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.