Java EE consists of the following components
- JavaBeans
- JNDI - Java Naming and Directory Interface
- EJB
- Servlets
- JDBC
- JSP
- RMI
- RMI-IIOP
-- Remove All Rows from a Table | |
TRUNCATE TABLE user; | |
-- Create a CHECK constraint to ensure consistency within the tables (e.g. for enumeration values or for consistency rules based on multiple columns) | |
-- Unnamed inline CHECK constraint | |
CREATE TABLE Persons ( | |
Age int CHECK (Age>=18) | |
); | |
-- Named inline CHECK constraint |
// imports a couple of java tasks | |
apply plugin: "java" | |
// List available tasks in the shell | |
> gradle tasks | |
// A Closure that configures the sourceSets Task | |
// Sets the main folder as Source folder (where the compiler is looking up the .java files) | |
sourceSets { | |
main.java.srcDir "src/main" |
There is a MANIFEST.MF file in .jar files | |
It supports a wide range of functionality: | |
* electronic signing | |
* version control | |
* package sealing | |
It always sits in "META-INF/MANIFEST.MF" | |
The creation of a .jar file includes the creation of a default manifest file |
// Move cursor to end of line (eol) | |
$ | |
// Move cursor to the beginning of line | |
0 | |
// Move cursor to the first character of the next word | |
w | |
// Move cursor to the last character of the word |
// Open a file with the default App for this kind of filetype | |
open README.txt |
-- Start Transaction update a row and rollback transaction | |
BEGIN TRANSACTION | |
UPDATE user SET username='peter' WHERE id=2 | |
ROLLBACK TRANSACTION | |
-- Start Transaction update a row and commit transaction | |
BEGIN TRANSACTION | |
UPDATE user SET username='peter' WHERE id=2 | |
COMMIT TRANSACTION |
# Start MongoDB server | |
> mongod | |
# Start MongoDB CLI client | |
> mongodb | |
# Create or open database "myDatabase" | |
> use myDatabase | |
# Show a list of all databases |
// VM Arguments vs. Program Arguments | |
// Program Arguments are accessible via the main() methods String[] args array | |
// VM Arguments are accessible via System.getProperty(<vm-arg-name>) | |
java [-D<vm-arg-name>=<vm-arg-value>] MyJavaProgram [<program-arg-value>] | |
// Activate Remote Debugging on JVM via Java Debug Wire Protocol (JDWP) | |
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=7777 | |
// Listening for a debugger to connect: Yes or No | |
// No: JVM tries to connect to a debugger under the "address" field |
// - DEBUGGER - | |
// Run to a specific line | |
Move cursor to the line -> Press "Ctrl + R" | |
// Terminate execution | |
Ctrl + F2 | |
// Toggle Breakpoint | |
Ctrl + Shift + B |