Category Archives: Database

Normalization Rules in Database

First normal form First normal form states that at every row and column intersection in the table there, exists a single value, and never a list of values. Second normal form Second normal form requires that each non-key column be … Continue reading

Posted in Database | 2 Comments

Cannot load JDBC driver class ‘com.microsoft.sqlserver.jdbc.SQLServerDriver’

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver class ‘com.microsoft.sqlserver.jdbc.SQLServerDriver’ ;;;;;;;;;; I got this exception when I tried to connect SQLServer2005 using Tomcat in Eclipse. I fix this issue by placing ‘sqljdbc.jar’ in tomcat/common/lib directory.

Posted in Database | 6 Comments

How to get second highest emp salary from emp table?

There are so many ways to get it. The following are 3 ways: 1) SELECT max(esal) as salary FROM emp WHERE esal < (SELECT max(esal) FROM emp) 2) Select * from emp A where 0 = (select count(*) from emp … Continue reading

Posted in Database | 2 Comments

DataSource Creation for MSSQLServer2005 using SJSAS8.2:

1)Open server admin console by giving username and password if exists. 2)There goto Application Server -> Resources -> JDBC-> Connection Pools -> select New->   Name: mssqlpool   Resource Type: javax.sql.DataSource   Database Vendor: mssql   Next-> Enter DataSource Class … Continue reading

Posted in Database | Leave a comment

Connecting to MSSQL SERVER 2005 from NetBeans5.5:

1)Download SQL server driver -> unzip it to folder like MicroSoft SQLSERVER 2005 Driver 2)Open Netbeans IDE-> open Runtime window -> select Databases-> right click on Drivers ->     Select New driver -> Enter the following details    i)Driver file: … Continue reading

Posted in Database | 3 Comments