oracle10g - Connection refused error in oracle 10g -
i beginner in oracle 10g. have tried connect oracle 10g database. here code:
package com.lara; import java.sql.*; class x1{ public static void main(string args[])throws exception{ class.forname("oracle.jdbc.driver.oracledriver"); connection con=drivermanager.getconnection("jdbc:oracle:thin:@localhost:1521:xe","scott","tiger1"); statement stmt=con.createstatement(); string sql="create table emp(sno int,name varchar(90),age int)"; stmt.execute(sql); } }
but getting error:
exception in thread "main" java.sql.sqlexception: io exception: connection refused(description=(tmp=)(vsnnum=169870080)(err=12505)(error_stack=(error=(code=12505)(emfi=4)))) @ oracle.jdbc.dbaccess.dberror.throwsqlexception(dberror.java:134) @ oracle.jdbc.dbaccess.dberror.throwsqlexception(dberror.java:179) @ oracle.jdbc.dbaccess.dberror.throwsqlexception(dberror.java:333) @ oracle.jdbc.driver.oracleconnection.<init>(oracleconnection.java:404) @ oracle.jdbc.driver.oracledriver.getconnectioninstance(oracledriver.java:468) @ oracle.jdbc.driver.oracledriver.connect(oracledriver.java:314) @ java.sql.drivermanager.getconnection(unknown source) @ java.sql.drivermanager.getconnection(unknown source) @ com.lara.x1.main(x1.java:7)
possibly firewall issue. turn off firewall or open port 1521.
Comments
Post a Comment