是否有任何选项可以连接(在JAVA中)像SQLite这样的Oracle数据库?

时间:2017-05-02 14:06:13

标签: java database oracle sqlite

是否有连接Oracle数据库的选项,如(SQLite):

 Connection conn = null;
    try {
        // db parameters
        String url = "jdbc:sqlite:C:/sqlite/db/chinook.db";
        // create a connection to the database
        conn = DriverManager.getConnection(url);

        System.out.println("Connection to SQLite has been established.");

我希望我的Oracle数据库位于程序目录中,如下所示:

 String url = "jdbc:sqlite:C:/sqlite/db/chinook.db";

Oracle DB Connetion:

try{     
     Class.forName("oracle.jdbc.OracleDriver");
     Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","system","oracle");
     return con;   

我不想像

那样运行localhost
DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","system","oracle");

0 个答案:

没有答案