有没有办法在java中检索url的绝对路径(http:// localhost:8080/myApp).方案是,我需要连接到位于tomcat服务器的csv文件.如果我输入绝对路径,该语句很有效,但是有一个解决方案可以使用getAbsolutePath()检索url的路径.抱歉,如果我错了.
Connection conn = DriverManager(getConnection("jdbc:relique:csv:/home/apache-tomcat-6.0.26/webapps/myApp/"))
Run Code Online (Sandbox Code Playgroud)
提前致谢.