J
JAVAFAN
Unregistered / Unconfirmed
GUEST, unregistred user!
在212.111.12.22的主机上的D:/TEMP目录下有一个employee.gdb数据库,其中有一张表是country(包含country,currency两个字段)。我用下面的代码访问这个数据库,但是编译时提示在getConnection这一行处有错误,请各位高手帮忙:
import java.net.URL;
import java.sql.*;
public class DbTest {
public static void main(String args[]) {
Connection con=DriverManager.getConnection("jdbc:http://212.111.12.22:80 d:/temp/employee","SYSDBA","masterkey");
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery("select * from country");
System.out.println("country:"+rs.getString("country"));
}
}
import java.net.URL;
import java.sql.*;
public class DbTest {
public static void main(String args[]) {
Connection con=DriverManager.getConnection("jdbc:http://212.111.12.22:80 d:/temp/employee","SYSDBA","masterkey");
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery("select * from country");
System.out.println("country:"+rs.getString("country"));
}
}