SQL Server – v2019 / Java JDK – Binaries

Background Thankfully, with SQL Server version 2019, Microsoft bundles a Java JDK. Lineage Past In the past one will go to the Oracle Web Site and download a Java JDK. Once downloaded the JDK will be installed. To ensure that SQL Server installation is aware of the install, one needs to restart the SQL Server … Continue reading SQL Server – v2019 / Java JDK – Binaries

Java/JDBC – SQL Server – “Integrated Security”

Background Wanted to go over the steps to take when one needs to connect to a Microsoft SQL Server Instance using Integrated Security. Outline Java JDBC JDBC Connecting String Class Path Includes SQL Server JDBC Driver  System System Path Add [jdbc-sql]\enu\auth\[platform]\ Tasks Java JDBC JDBC Connecting String Outline JDBC URL IntegratedSecurity=True authenticationScheme=NativeAuthentication Syntax Sample java … Continue reading Java/JDBC – SQL Server – “Integrated Security”

Hibernate / DB Metadata

Background In the early stages of learning Hibernate, I wanted to get some metadata about my database. But, was lost as to how to do so. Outline Connect to Database Get Session Cast Session to sessionImpl Get Connection from sessionImpl Get metadata from Connection Access metadata getURL getDriverName getDatabaseProductName getDatabaseProductVersion getUserName getDefaultTransactionIsolation Code   Output … Continue reading Hibernate / DB Metadata

java – Log4j

Background Playing around with Hibernate got me staring at the screen reviewing console messages; especially SQL statements. Log4j Time to implement better logging; mostly instead of having it show up on the console, placing it in log files. Download Artifacts log4j is available here ( https://logging.apache.org/log4j/2.x/download.html ). Version The current version is 2.11.2 Download Please … Continue reading java – Log4j

Java – Set – Method – Remove – Null Exception

Background Trying to familiarize myself with Collection classes in Java. With Hibernate being an ORM tool that encapsulates database processes, one has to have a good grasp of records and set operations. Error I ran into a blocking error. It simply read null.   Code Original Code Java Snippet Output Exception Revised Code Java Snippet … Continue reading Java – Set – Method – Remove – Null Exception

Hibernate – Error Message – “Unknown entity”

Background Learning new tooling is not easy for me. Error Image Textual Trouble Shooting Metadata Entities Registered Outline Start a Session or use an existing one Get Session's Transaction handle Start a new transaction Get Session's metamodel Get Metamodel entity list Iterate Metamodel entity list Commit Transaction Code Similar Errors @OneToOne or @ManyToOne on [entity] … Continue reading Hibernate – Error Message – “Unknown entity”