Archive for November, 2005

JSF JDBC connection to SQL server 2005

November 29, 2005

I have fianlly got around to figuring out how to connect to a sql server 2005 using a JDBC in JSF. Here is how my code look:

import java.sql.*;try{ java.lang.Class.forName(“com.microsoft.sqlserver.jdbc.SQLServerDriver”);Connection connection = DriverManager.getConnection(“jdbc:sqlserver://localhost;databaseName=dbName1;user=user;password=password”);}catch(Exception ex){ System.out.println(ex.getMessage());}
the line:
java.lang.Class.forName(“com.microsoft.sqlserver.jdbc.SQLServerDriver”);
will register the JDBC driver that I downloaded from Microsoft from the site:
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/jdbc.mspx
so that your DriverManager class can use it [...]

Posted in Uncategorized No Comments »

JSF has begun

November 28, 2005

I finally got around to getting my teeth into JSF. I like it so far. Its so very different to .NET (which I have been programming in for quite some time now).
I successfuly made a database connection to SQL server 2005 last night and got the results I was looking for, so Im happy.
Details about [...]

Posted in Uncategorized No Comments »