0

我正在创建一个 java 应用程序来发送将自动销毁的消息。

所以我想要一个在线数据库来存储各种用户的用户名和密码。我正在使用 H2 数据库将这些详细信息存储在本地,并将 Filezilla 服务器用作本地 FTP 服务器。

所以我想知道在将它传输到网络后如何使用相同的数据库。这是我目前的 Connection 方法的相关部分:

    String current = new java.io.File( "." ).getCanonicalPath();
    Path path = FileSystems.getDefault().getPath(current,"/Files");
    System.out.println(path.toString());
    current+="/Files/Databases/Message";
    String host = "jdbc:h2:file:"+current;
    String uName = "sa";
    String uPass = "";
    con=new Connection[Size];
    stmt=new Statement[Size];
    for(int i=0;i<Size;i++)
    {
    con[i]=DriverManager.getConnection(host, uName, uPass);
    stmt[i]=con[i].createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
    }

更具体地说,将数据库移动到远程 FTP 地址后,主机应该是什么?

在此先感谢您的帮助:)

4

0 回答 0