RMI Summary (original)

Source: Internet
Author: User

When I completed my homework, I felt that the Java programming models were all well done, but during implementation, the detailed problems always lead to failures. it is easy to think that it is a language giant and a little bit of action. in fact, it is far from that difficult to do, but these small problems are bothering yourself. so write them down below, so it is no longer a detour. i'm doing Program When using jbuilder2006 Enterprise Edition + SQL Server 2000 + SP4 + Microsoft SQL Server 2000 SP4. these software must be available before the system is installed. the next step is to set the environment variables path, classpath, and javahome. among them, javahome does not know whether it is necessary to set. it should be noted that although jbuilder2005 has installed JVM on its own, it is necessary to set these environment variables, because when the application is running, you still need to find the files indicated by these environment variables. path settings: Path = E: \ Borland \ jbuilder2006 \ jdk1.5 \ bin (I have jbuilder2006 installed on the E disk on my machine, because I want to run some executable files in the JDK. so set the JDK path ). classpath = .; d: \ RMI \ formal \ Classes; C: \ Program Files \ Microsoft SQL Server 2000 driver for JDBC \ Lib \ msbase. jar; C: \ Program Files \ Microsoft SQL Server 2000 driver for JDBC \ Lib \ MSSQLServer. jar; C: \ Program Files \ Microsoft SQL Server 2000 driver for JDBC \ Lib \ msutil. jar; pay attention to the previous .; must be added. Article . In this case, you must set the three class paths of jdbcfor SQL Server and the class paths of your own applications (D: \ RMI \ formal \ Classes ;). The installation path of Microsoft SQL Server 2000 driver for JDBC is displayed. Java_home = E: \ borlandbak \ jbuilder2006 \ jdk1.5 note that the equal signs of these environment variables cannot contain spaces on both sides. After completing the above work, you don't have to worry about these issues when running the program. You can directly run the rmid daemon. The next step is to set up a JDBC connection in JBuilder. Many articles on the Internet are talking about this issue and there are usually no errors. (Note that, there is a connection string that uses localhost and cannot use an IP address ). When configuring port 1433, you can find the steps to open the port on the Internet, as long as you go to Enterprise Manager to find the registered Server property to set it. The next step is to program based on the RMI programming model. For details about how to do this, refer to Sun's RMI programming specifications. For beginners, there are RMI programming examples in the JBuilder sample directory. You can take a look at them first. Then, you can run the non-activated RMI program on that basis, which makes it easy to do so. During running, go to the Tools menu of JBuilder to find the RMI Registry, and then run it. Then go to the server side to implement the server interface Code Compile the stub. In JBuilder, right-click your implementation file, select the check box generate RMI stub/skeleton on the build tab, and enter-v1.2 in the following Guangxi box, OK. When setting the running parameters of your server and client programs, you need to select the properties page of your project, and then select "new", and set your own name, such as server or client, then the server parameters are:-djava. RMI. server. codebase = file :( $ projectdir) \ Classes \-djava. security. policy = file :( $ projectdir) \ simplermi. policy, and select the main class you want to run, that is, the class containing main. Client parameters:-djava. security. policy = file :( $ projectdir) \ simplermi. policy. Note that the client does not need to set codebase. the next step is to run the server and client programs. Right-click the server files in the project and select the run mode you Just configured to run the program. (Write it here today. It may not be clear for the first time. Try to fix it later)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.