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

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”

Hibernate – SQL Server – Exercise – 01

Background Wanted to share source code for a sample helloDB Script that I am trying to use as I self teach Hibernate. Outline Database File DDL Table dbo.Country Java Source File helloDB.java Hibernate Configuration File SQLServerSavila.cfg.xml Entity Country Country.java ( POJO File ) Country.hbm.xml ( XML ) Source Code Database DDL Table Country Source Code … Continue reading Hibernate – SQL Server – Exercise – 01

Eclipse/Hibernate – Installation – Day/01

  Outline Download & Install Eclipse JDBC Driver Microsoft JDBC Driver Download Microsoft JDBC Driver Configure Database Microsoft SQL Server Provision Database WideWorldImporters ( Sample Database ) Restore Database Provision Principal Create SQL Server Principal Grant Principal access to database Grant principal access to database objects Configure Eclipse Install Components JBoss Tools Hibernate Tasks Download … Continue reading Eclipse/Hibernate – Installation – Day/01

Eclipse – Data Source Explorer – SQL Server – Configuration ( Day 01 )

Background Ran into a blocking issue while playing around with Eclipse. The issue surfaced while trying to configure Hibernate to connect to SQL Server.   Data Source Explorer I tried using the Hibernate Data Tools to connect to my back-end database; SQL Server in this case. Finally gave up and wanted to see if I … Continue reading Eclipse – Data Source Explorer – SQL Server – Configuration ( Day 01 )