Installing MS Sql Server JDBC 4.0 Driver

by Codewiz51 23. February 2014 07:02

My company has a major new initiative to utilize open source software.  While I'm primarily a Microsoftie, my C++ skills have not been in great demand, so I've volunteered to go over to the dark-ish side.  At work, we are utilizing PostgreSQL and PostGIS heavily for our mapping and search applications.  However, at home, I'm still a big fan of MS SQL Server, particularly SQL Server 2012.  I'm in the process of learning JBoss at work, and I work with it at home "A LOT!" However, I prefer to step through the examples with SQL Server 2012.

Which brings me to the point of this post: How the heck do I point my Java stuff to use SQL Server 2012 from Eclipse, Maven, JBoss, TomCat, etc.?

I found this thread on which really helped me get up and running on my home system: Setting up maven dependency for SQL Server

  1. I thought I would summarize all the inputs into a few steps that are easier to follow:
  2. Download and Install SQL Server JDBC driver from Microsoft: Microsoft JDBC Driver for SQL Server
    (I suggest installing to a much shorter directory name than the default.  The default directory is a pain to use and involves the use of quotes to get around spaces in the FQ path.)
  3. Optional: Install to a network location that is available to your whole team.  You'll see why this is useful in a following step.
  4. Install Maven on your PC so you can run it from the command line: How to install Maven on Windows
  5. Install the SQL Server JDBC driver in your local Maven Repository with this command:
    mvn install:install-file -Dfile="C:\Program Files\Microsoft JDBC Driver 4.0 for SQL Server\sqljdbc_4.0\enu\sqljdbc4.jar" -DartifactId=sqljdbc4 -Dversion=4.0 -Dpackaging=jar
    You may need to adjust the file path, version and/or file name. Don't just copy this command line blindly!
  6. If you installed to a network location instead of a local directory, you can add the following to your pom.xml, and all your team can gain access to the driver without having to perform a bunch of setup steps:

I hope this helps someone.  If you have questions, please search Google using the following terms: "Maven SQL Server JDBC."


Eclipse | Java | JBoss | Maven

Switching to Git from TFS

by Codewiz51 25. December 2013 09:44

I've been involved with Git at work since late May of 2013.  Transitioning to Eclipse, Java and Git was a bit intimidating in the beginning.  However, after some bumps in the road learning how to utilize Git, I became a convert to this version control system.  It's light weight, fast and runs well on Windows Server 2012.  I'm slowly migrating my projects off of TFS 2010 to a local Git repository.  What really sold me on Git is the ease of branching and merging operations.  Then, I discovered the add-in component for VS 2013 works as well or better than Eclipse's integration of Git.  About the only thing I am losing when I leave TFS is work item tracking.  However, that function will be filled by a $10 copy of Jira for my personal use.

I don't own powerful server hardware.  So Git is a Godsend compared to how TFS 2010 and Sharepoint 2010 drag on my outdated servers.

This series of blog posts will cover my experiences installing and configuring's version of Git for Windows:

  1. Stuff to download: (Prerequisites)
    • First, check out this post on MSDN to make sure your VS 2013 git client is operational. I strongly suggest you make sure you can connect VS 2013 to a github or bitbucket project and clone successfully before you even begin downloading anything else.  (I started out using github, but switched to bitbucket.  Bitbucket allows me access to Jira functionality (issue tracking) and code reviews (limited.)  It's free and allows private projects.
    • I like to install a command line git tool.  I use Chocolatey to install git command line tools.  I've run into some issues getting this to work over SSL, but I've solved all the problems and documented them in this series of articles.
    • If you are going to use Git over SSL, you'll may need OpenSSL for Windows.  GitStack needs an RSA key file, and OpenSSL is the only way I know to generate this file and create a certificate request tied to the key file.
    • You'll need the git installer.
    • I generally like to have a copy of Cygwin available.  This is completely optional, not required and not really used for this install (unless something goes incredibly wrong.)
    • There's probably some other stuff I've forgotten.  I'll add downloads here as time and memory permits. Cool
  2. Install
  3. Configure ports
  4. Firewall Changes
  5. Users and Groups
  6. LDAP/Active Directory
  7. OpenSSH/CertSrv/SSL
  8. Testing
  9. VS 2013 and Git
  10. Git-tfs

Since it's Christmas morning and the family is waking up, I'll fill in the details later today and tomorrow.  I need to go prepare Christmas breakfast for the World of Ware Crack crowd.


Design | Infrastructure | Programming

The Puzzling Size of Refrigerators

by Codewiz51 15. September 2013 07:52

I've gotten a bit hung up on HGTV Network's "House Hunters: International" serial semi-reality/semi-fantasy series.  One of the big questions I have for the series comes from the size of refrigerators.  Generally, it seems as though almost every other country manages to survive with refrigerators and freezers that are one third the size of American refrigerators.  Why is this?

  • First of all, Europeans must not need to/not be able to "stock up" on perishable food.
  • Do they need to shop more often?
  • Do they eat out more?
  • Do they purchase take out food more often?
  • How do Europeans in rural areas obtain food?
  • Do they have to make long treks to villages that are big enough to have markets?
  • Do they eat lots of canned food?
  • Do Europeans waste less food because it doesn't rot in the refrigerator?

My own personal experience says that we purchase lots of healthy fresh perishable items.  Then, we are too tired to cook during the week, or too over scheduled during the week to cook, or simply too lazy to cook during the week.  We end up trashing a fair amount of food items because they go bad in storage.  Maybe, if we were realistic, we would only buy a couple of days of perishable foods, ostensibly we would have more realistic expectations of our time.

I know this is an inane question, but I'd really like to understand how other cultures get by with such tiny refrigerators.

Tags: , , , ,


When did I become a Java Developer?

by Codewiz51 20. July 2013 07:33

I've been working in Java/Eclipse for two months.  I'm not accomplished at it (at least in the sense of C++ and C#), but I am becoming  competent and confident every day: RESTful web services, Java classes and project set up.  In addition, I'm writing a lot of UI code in JavaScript, something I never would have believed even two months ago.

I'm also writing iOS applications that interface with these web services.  I'm not good at the UI/object C part of the dev cycle, but my C++ components are working and in production.

Who would'a thunk it?

Subjects where I need to increase my knowledge:


Server 2012 and Private Network instead of Domain Network

by Codewiz51 14. July 2013 11:06

I recently tried to connect to SQL Server 2012 executing on my Windows Server 2012 box from my Windows 8 laptop.  I was unable to connect to the service, which was odd, because I use it extensively and often with VS 2012 to develop example applications.

A quick check of the Network and Sharing applet in Control Panel showed that the server did not recognize that it was on a domain network.  Instead, the N&S applet displayed private network.

A quick check showed that File and Printer Sharing AND Network Discovery were turned off.  This was rather odd, as I use this machine as a back up domain controller.  A quick check of services showed several were disabled.

If you are having this issue, perform the following checks:

  1. Make sure DNS Client is enabled and executing
  2. Function Discovery Resource Publication is enabled and executing
  3. SSDP Discovery is enabled and executing
  4. UPnP Device Host is enabled and executing

After making corrections, make sure the following are enabled in Advance sharing settings of Network and Sharing Center:

For Domain network settings,

  1. turn on network discovery
  2. turn on file and printer sharing

Reboot your Server 2012 machine and you should be good to go.

Tags: , , , ,


This blog represents my personal hobby, observations and views. It does not represent the views of my employer, clients, especially my wife, children, in-laws, clergy, the dog, the cat or my daughter's horse. In fact, I am not even sure it represents my views when I take the time to reread postings.  So, take most of what I say with a grain of salt.

© Copyright 2008-2014