In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
In this issue, the editor will bring you about how to import the Oracle database in Java. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.
What are the characteristics of Java? what are the characteristics of Java? what is the 1.Java language that represents the static object-oriented programming language? it implements the object-oriented theory and allows programmers to carry out complex programming in an elegant way of thinking. 2.Java has the characteristics of simplicity, object-oriented, distributed, security, platform independence and portability, dynamic and so on. 3. Using Java, you can write desktop applications, Web applications, distributed systems, embedded system applications, and so on.
Import java.io.IOException / * Java code to import the backed up database file into the Oracle database * * @ author:Gaohuanjie * / public class OracleImportDatabase {/ * import the backed up database file * * @ author:Gaohuanjie * @ param userName into the Oracle database the user name required to enter the database * @ param The password required for password to enter the database * @ param SID user's SID * @ param fromUserName imported data file the original user * @ param filePath does not contain the backup file path of the database with the extension * @ return returns true to indicate that the import is successful Return false to indicate import failed * / public static boolean importDatabase (String userName, String password, String SID, String fromUserName, String filePath) throws InterruptedException {String toUserName = userName Try {Process process = Runtime.getRuntime () .exec ("imp" + userName + "/" + password + "@" + SID + "fromuser=" + fromUserName + "touser=" + toUserName + "file=" + filePath + ".dmp"); if (process.waitFor () = = 0) {/ / 0 indicates that the thread terminates normally. Return true;}} catch (IOException e) {e.printStackTrace ();} return false } public static void main (String [] args) throws InterruptedException {if (importDatabase ("gaohuanjie", "ab19890110", "orcl", "gaohuanjie", "D:\\ oracledb") {System.out.println ("Database imported successfully!") ;} else {System.out.println ("Database import failed!!") ;} the above is how to import the Oracle database into Java. If you happen to have similar doubts, please refer to the above analysis. If you want to know more about it, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.