高手救命啊,java访问oracle出错

高手救命啊,java访问oracle出错

用此访问oracle数据库出错,DBAStudio可以访问
jdbc:oracle:thin:@192.168.1.2:1521:oradb


错误如下,望高手告诉原因,谢谢了!谢谢了!


java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection

        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)

        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:211)

        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:324)

        at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:266)

        at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:365)

        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)

        at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:99)

        at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.execute(OpenConnectionCommand.java:112)

        at net.sourceforge.squirrel_sql.client.mainframe.action.ConnectToAliasCommand$SheetHandler.run(ConnectToAliasCommand.java:345)

        at net.sourceforge.squirrel_sql.fw.util.TaskExecuter.run(TaskExecuter.java:65)

        at java.lang.Thread.run(Thread.java:536)      
从你执行java的机子上能不能ping 到数据库,注意ping的是oracle network里面的hostname,不通的话就会出上面的错误
另一个原因就是你的Oracle版本?如果8i的话而且开启了mts,也会出现上面的错误,看看oralce 配置文件init.ora,关闭mts,然后restart oracle      
怎么ping 数据库啊?机器肯定能ping通的
怎么关掉mts啊?

再次谢谢帮忙!      
把mts_dispatcher开头的两行注掉,然后重起数据库就好了

devil4heaven是高手!厉害!      
devil4heaven能不能详细讲一下具体的原理啊?
特别想知道.