First of all, I just learned Java, just a cainiao. The following content does not share any experience. I just wrote some ideas about using Java for database course design in words. I hope it will be helpful to some people who just learned Java, of course, I also hope that you can give me some advice and point out the shortcomings and unreasonable points so that I can make some improvements.
I just learned Java and used Java to design a database course a few times ago. It is mainly used to manage a business management system of a graphic company. Generally, it has some query orders, add an order, modify the basic functions of the order, and use a regular expression to set certain constraints on the data input type. Let's talk about the general production process.
The first is the construction of databases. using SQL Server, several tables are created to store order records in different states, such as pre-orders, construction orders, delivery orders, and historical orders, after the data is created, some data can only be selected between several data sets. This ensures that the inserted data must be one of several data sets, for example, gender is only a data such as male or female. However, if some data fields are restricted in the database, there will also be some drawbacks for future expansion. For example, one field in my order record is the order model, if there is a type and B type, if there is another type called C type in the future, then you need to modify the data constraints in the database. This affects future scalability. If anyone has a better solution, please kindly advise.
Secondly, it is a program design. Of course, the stored procedure is not used in my database, so it is relatively simple. Next, we will design a simple framework, such as the approximate layout of the interface. Then, the focus of this database Course Design
The development tool I used is jbuilder2006, which contains a control group called dbswin. It is not suitable for database development, but it has high requirements on computer configuration, there is not a certain high CPU clock speed, and a large memory space, it will be very difficult to use. (There are two small ways to slightly improve. 1. Under the installation directory of jbuilder2006, find a file named jbuilder2006.config under the bin/directory, there is a line in it that is about the default maximum memory space and minimum space of the running software. It is slightly larger, but it seems to conform to a certain number. It can be changed to a minimum of 256, the maximum value is 512 2. After jbuilder2006 is run, open the task manager and set the priority of the process to high)
1. database connection problems. In jbuilder2006, there is a tool/database pliot that can be used to test the database connection.
I am using port 1433 for connection and related drivers. If the connection fails, it may be one of the following reasons:
: Port 1433 is not enabled. You can enter netstat-an in the command prompt. If the port 1433 is in the listening status, it indicates it has been enabled. There are several files to be connected: An SQL Server SP4 patch, and Microsoft needs to introduce three jar packages for JDBC. You can search for details on the Internet.
2. Use dataexpress in jbuilder2006 to pull out a database and set it to connect to your database.
3. Use a jdbtable table for query, set its dataset to querydataset (which can be found in dataexpress), and set the corresponding query statement in querydataset, this is generally used to initialize a table. For queries based on a keyword, I nest the corresponding code in the corresponding button: Generally, a new querydataset is created, and then use the syntax that can contain parameters. Is it written into an SQL statement? And then input the corresponding parameters. Other production modes are probably the same.
4. One is about the Dynamic Refresh problem after the table has been modified. This has been bothering me for a long time, but I finally found a solution, that is, after querying or modifying it, I will add one more sentence under your statement, for example, table, it is. Getdataset. Refresh () to achieve dynamic refresh. In fact, this method calls the refresh () function in the original default toolbar jdbnavtoolbar.
5. I found that JBuilder has a more useful or powerful function, that is, the master-slave relationship can be set between two sheets, but when I click a different record, another table will automatically change accordingly. To put it bluntly, its principle is similar to nested queries, that is, one query is used as another query parameter.
6. In this design, the following problems cannot be solved. One is how to modify the record of a column in a jabtable to implement functions similar to jdbcombobox, is a drop-down box. It seems that you can set its jdbpicklist, but I tried it. When the column has been created and the data is available, it does not respond after it is set. The other is the implementation of the report function. Although I know some components such as ireport, I still cannot solve this problem about how to call it in the application.
The above are some of your little experiences or gains. I hope it will help you, and I hope you can correct it. Detailed implementation reports can be sent to homssk@126.com with me. Of course, I also hope you can point out the errors.