Hot answers tagged

7

Application Architecture The architecture of the application is divided into models and views to separate the data and business model from the user interface. Within the models there is an additional division, there are models that represent the database tables and there are models that represent a row of data within each database table. You missed ...


6

No, don't do that. You seem to be filtering and escaping values out of paranoia rather than understanding what exactly would lead to a vulnerability. As a result, you are corrupting your data. A well designed application should use the database to store the value that the user typed into the textarea, not some mangled representation of it. If you mangle the ...


5

Problem Statement Tiered Architecture This database is the first part of the project, I couldn’t really create a friendly user interface until the database is working. Due to feature creep this database can now handle other kinds of books besides science fiction and fantasy. The most important step when taking on a project as you have, is deciding ...


5

Funny coincidence, I just created the solution for your problem (but in PHP). The common thing here is the one-time use of a prepared statement, the difference is in the query string and arguments, so what you need is a function that accepts a query string, an argument determining what execution function to use (executeQuery() or executeUpdate()) and the ...


4

You must never store passwords as plain text in the database. Read an article about password hashing to avoid this mistake in the future. Make sure that you have a unique index on the username column. Otherwise it will be possible to create several users with the same username, and with equal or differing passwords.


2

I first had to look up what KPI stands for. It is a "Key Performance Indicator". Then a "KPI breachable event" must be when some indicator gets over a certain threshold? That's my best guess... Better not use an abbreviation, or jargon, that is unrelated to programming, when explaining what your code is doing. There's a big change we don't know what you're ...


2

Probably it's better to you concrete node version. Also, you can try expressjs framework. I have got simple example of Dockerfile here in this sub-directory of my repository. But that is without Docker Compose and connection to any database.


2

You should really try to use a more modern approach to closeable resources. The try-with-resources statement has been introduced in Java 7 (2011). This gets rid of all the hocus-pocus around closing and nested exceptions for you. Trivial rewrite of the first function: public static boolean checkLogin(String username, String password) { Connection ...


1

You can decide between to structural design patterns: Template Method Pattern Strategy Pattern I would go with the Template Method Pattern because you do not reuse the algorithm which is a benefit of the Strategy Pattern. In the first step we need to create an abstract class which has all the common code and a invocation of an abstract method where the ...


1

I'm pleased to see you included DDL and dataload SQL. This makes reviewing a bliss. Design There isn't really much I can say about this design. You wondered whether your many-to-many relation is well being dealt with. Well, you created a composite primary key, which is correct for this design because a car and a feature are not strongly dependent on each ...


Only top voted, non community-wiki answers of a minimum length are eligible