473,385 Members | 1,555 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

SQL SERVER 2005 connection in java

I am using following code and am using sqljdbc.jar file in lib folder of my project . but getting SQL Exception & Null pointer Exception,what is the reason? please Help me

Expand|Select|Wrap|Line Numbers
  1. DBConnectivity.java
  2.  
  3. try{ Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver);
  4. connection =DriverManager.getConnection("jdbc:sq lserver://localhost:8089;databaseName=bill;integratedSecu rity=true;");} 
  5.  
,
Expand|Select|Wrap|Line Numbers
  1. NewFile.jsp
  2. <%
  3. Connection con=DBConnectivity.getCon();
  4. Statement st=con.createStatement();
  5. String sql="select * from emp";
  6. ResultSet rs=st.executeQuery(sql);
  7. %>
  8.  
,
Expand|Select|Wrap|Line Numbers
  1.  Error Messages
  2.  1)java.lang.NullPointerException
  3.  2)com.microsoft.sqlserver.jdbc.SQLServerException: 
  4.  
Apr 26 '12 #1
0 1215

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Carlos | last post by:
Hi all, I have a ASP.NET app that uses SQL Server 2000 to access the data over the internet and everything works fine . However, I just installed SQL server 2005, and wanted to test the remote...
3
by: Joey | last post by:
Hello all, I develop on two or three different machines at different times. I need a connection string in my app that will always reference the local instance (for whatever machine) of Microsoft...
4
by: Greg P | last post by:
I know this is a long post, please bear with me. I have been working on this all weekend to no avail although I have done a good amount of research (see most pertinent links that I've looked at...
2
by: Rico | last post by:
Hello, I have a Win2K3 Server with SS2005 developers edition. I am working on a Windows XP Pro workstation which has SQL Server 2000 installed as well as the SQL Native Client. I'm using an MS...
0
by: ArunkumarWizteam | last post by:
Recently we have upgraded our Database to sql server 2005, but we are getting the following error : "When connecting to SQL Server 2005, this failure may be caused by the fact that under the...
9
by: Gabriel | last post by:
Hello, I installed SQL server 2005 SP1 on a Windows XP SP2 From Visual Studio, I'm trygin to create a connection to a database, but I receive this error but I'm creating the connection (I...
3
by: Lee T. Hawkins | last post by:
I am having a number of problems over the last two full days trying to get an ASP.NET 2.0 application to connect to a SQL Server 2005 database... First off, I built this application w/ Visual...
2
by: samadams_2006 | last post by:
Hello, I have a problem that I'm hoping someone will be able to help me resolve. 1) I have a C# Web Site in which I connect to the database: "Install Microsoft SQL Server 2005 Express...
1
by: bimowidhi | last post by:
Hi, I'm a newbie here, and also in PHP. Sorry for my bad English. I've walked around to find the answer of my problem, but I still can't get it. I develop PHP 5.2.5 Application, using SQL...
0
by: Prateek Gangwani | last post by:
Hey guys i have created a JSP page including one JSP form(which i have created with the help of HTML tags). Now i am facing the problem..as to how to store the information provided by the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.