hi以下代码正在编译,但运行时错误为:
"Exception in thread main com.inet.ora.Ora3SQLException:[OraDriver] java.net.UnknownHostException:@localhost"
代码:
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();
}}
这里我使用了inet jdbc驱动程序,请有人为我解决这个问题....
答案 0 :(得分:0)
尝试从localhost中删除@
"jdbc:inetora:localhost:1521:orcl"...