Jdbc 主线程com.inet.ora.Ora3SQLException:[OraDriver]java.net.UnknownHostException:@localhost中出现异常
您好,正在编译以下代码,但存在运行时错误,原因如下:Jdbc 主线程com.inet.ora.Ora3SQLException:[OraDriver]java.net.UnknownHostException:@localhost中出现异常,jdbc,Jdbc,您好,正在编译以下代码,但存在运行时错误,原因如下: "Exception in thread main com.inet.ora.Ora3SQLException:[OraDriver] java.net.UnknownHostException:@localhost" 代码: 在这里,我使用了inet jdbc驱动程序,请任何人为我提供解决方案……尝试从本地主机删除@ “jdbc:inetora:localhost:1521:orcl”… import java.sql.*; class
"Exception in thread main com.inet.ora.Ora3SQLException:[OraDriver] java.net.UnknownHostException:@localhost"
代码:
在这里,我使用了inet jdbc驱动程序,请任何人为我提供解决方案……尝试从本地主机删除@
“jdbc:inetora:localhost:1521:orcl”…
import java.sql.*;
class CreatingTable
{
public static void main(String[] ar)
throws Exception{DriverManager.registerDriver(new com.inet.ora.OraDriver())
Connection con= DriverManager.getConnection("jdbc:inetora:@localhost:1521:orcl","riya","java");
Statement stmt=con.createStatement();
int students=stmt.executeUpdate("create table class(name varchar2(20),rollno number(20)");
con.close();
}}