Required to create a table in the database.

Cells 1. Number 2. Date 3. Customer 4. Contact 5. Thickness 6. Dimensions (x, y, z) 7. Color 8. Stencil (+/-) 9. Difficulty 10. Gluing 11. Cost

It turns out very long table. I implement everything through JDBC and the output will be through the applet. Will it create such a large table correctly? Is it possible to somehow divide the table? But when printing on a sheet (output to the applet), it should contain all the cells.

PS I am learning on this java project. Is it possible to implement such a table in another way? XML?

    3 answers 3

    Of course, your structure needs to be normalized. All you need is fields 3. Клиент 4. Контакт replaced in the field "Contact_ID", which would refer to the record in the table "Contact" with the fields "ID, Customer, Contact". Yes, you save only one field, but the structure becomes closer to normal form (and it is just more logical) - at the same time study the one-to-many relationship and the JOIN operation :)

    If there are few records, there is no point in supporting a full-fledged DBMS. You can do it on an embedded DBMS, for example, sqlite3 (as far as I remember, there is support for it in jdbc), but you can, indeed, on XML files, although I personally don’t like this solution.

    To think about the number of fields as simply the number of fields is meaningless. In my practice, there was a table in which there were about a hundred fields - and it was unrealistic to improve it.

    In general, I recommend reading some theory on a DBMS that is minimally tied to a specific implementation (no "Learn Oracle in 15 minutes") - for example:

    1. Date K. Dzh. Introduction to database systems.
    2. Garcia-Molina G., Ulman J., Weed J. Database Systems. Full course.

    This is just what I remembered immediately.

    Successes!

    • ies) senk) - Aleksey Makas
    • You know) I was disappointed) I downloaded SqLite Admin and realized that my application is not needed) SqLite admin implemented what I had to implement ( - Aleksey Makas
    • In principle, that task could also be solved with the help of LibreOffice Calc or any other spreadsheet - but this is “unsportsmanlike” :-) Do it with a web interface, get valuable experience - it won't be superfluous! Successes! - SAABeilin
    • Sorry, the web interface is when through a browser? :) I just did it as a separate applet ... And if you implement it through servlets, then it will already be tense in terms of usage) Although ... Again, valuable experience, I will work with jsp ... And, there seems to be, the theme of Spring'a touches ... I reasoned correctly? - Aleksey Makas

    Well, you can certainly divide such a table into several and use foreign keys. For example, in a separate table to add products.

    • Oh .. and I thought of something else :) There must be a vaguely worded question .. - cy6erGn0m
    • No, you thought it right. Just your advice through the keys, I do not quite understand. I know what keys are. And how to share? There will be nothing common between the rows of the table. Customers do not repeat, the size of the orders - the same, the rest - generally purely technical issues .... Oh! And if they are taken out separately ... I just can not figure out how to arrange dependencies ( - Aleksey Makas

    Do you mean that the table will be long? Well, make some Lazy-load .. swing table is easy to file under it and load in small portions of on-demand. That's just through JDBC through the entire Internet do not need to do it ... not very nice ..

    • The application will be on the local computer and used on it, it’s like, Stand Elon is called) Okay. I will not specify technical details, there is a Google for this. But with the implementation - it turns out I’m implementing it in one table (not like Vlad Lisovsky suggested. And why do you say that through JDBC, through the entire Internet - it’s not beautiful? I have never simply encountered this, self-taught. - Aleksey Makas
    • Well, it's just generally not safe to stick a database on the Internet. It is better to make some kind of web service on the server in order to get data through it and thereby limit potential access and reduce risks. In addition, the number of connections to the database and the number of database sessions are limited more than the number of HTTP connections. - cy6erGn0m
    • And what about this topic you can read? Security? Implementing web services? (I don’t have any idea what a web service is, how it is implemented? The scheme is obtained - User -> Web site -> application on server -> DB (and back) So it works like a servlet? - Aleksey Makas