473,405 Members | 2,282 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,405 software developers and data experts.

Connecting to database JSP

hi all
i need help to connect to sql ser4ver usng jsp

i m using sql server 2000,i installed Microsoft SQL Server 2000
Driver for JDBC in my system....
i placed all jar files in class path....

when try to run my applicatio i m getting following error:

java.lang.ClassNotFoundException: com.microsoft.jdbc.SQLServerDriver


my code is :

<%@ page import = "java.io.*" import = "java.lang.*"
import = "java.sql.*" %>

<%
out.println("<h2>Successfully logged in</h2>");
try
{
Class.forName("com.microsoft.jdbc.SQLServerDriver" );
Connection con=DriverManager.getConnection
("jdbc:host://localhost:8080/ravi","srinivas","sa""sa");
Statement st = con.createStatement();

String sql="INSERT INTO ravi1 VALUES ('Michael', 'dba', '90000' )";
st.executeUpdate(sql);
}
Jan 23 '07 #1
2 3694
acoder
16,027 Expert Mod 8TB
You will get more help in the Java forum for your JSP problems.
Jan 23 '07 #2
r035198x
13,262 8TB
hi all
i need help to connect to sql ser4ver usng jsp

i m using sql server 2000,i installed Microsoft SQL Server 2000
Driver for JDBC in my system....
i placed all jar files in class path....

when try to run my applicatio i m getting following error:

java.lang.ClassNotFoundException: com.microsoft.jdbc.SQLServerDriver


my code is :

<%@ page import = "java.io.*" import = "java.lang.*"
import = "java.sql.*" %>

<%
out.println("<h2>Successfully logged in</h2>");
try
{
Class.forName("com.microsoft.jdbc.SQLServerDriver" );
Connection con=DriverManager.getConnection
("jdbc:host://localhost:8080/ravi","srinivas","sa""sa");
Statement st = con.createStatement();

String sql="INSERT INTO ravi1 VALUES ('Michael', 'dba', '90000' )";
st.executeUpdate(sql);
}
Set the mysqlserver.jar in your classpath before running your code. The command is something like:

set CLASSPATH=.;mysqlserver.jar;
Jan 23 '07 #3

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

Similar topics

4
by: John Morgan | last post by:
I have Enterprise Manager on my local machine. For the last twelve months it has been connecting without problem to my online SQL Server database provided by my ISP. Three weeks ago the ISP...
4
by: CodeImp | last post by:
A simple app I quickly wrote to try getting info from a database. Here is the first part of its code. The rest of the code is irellevant. using System; using System.Data; using...
12
by: Ann Marinas | last post by:
Hi all, I would like to ask for some help regarding separating the asp.net webserver and the sql server. I have created an asp.net application for a certain company. Initially, we installed...
5
by: Sebastian | last post by:
I'm using the following code to connect to an access 2000 database. (with reference to adodb) Public DBvar As New ADODB.Connection() DBvar.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data...
3
by: GTDriver | last post by:
I'm trying to connect my application with a web service located on my own web server(localhost). I guess when the solution/proect is built it makes a file called 'Web...
5
by: nielsgron | last post by:
Hi, I have created a database on DB2 8.1 and 8.2 for Windows using the codeset "Big5" with the command: db2 CREATE DATABASE TWBIG5 USING CODESET BIG5 TERRITORY TW When I try to connect to...
5
by: Odd Bjørn Andersen | last post by:
I have installed DB2 9 Enterprise Edition on my laptop and created the sample database. Now I'm having truble connecting to the database from Command Editor. If I connect from Command Window it's...
0
by: =?Utf-8?B?R2lkaQ==?= | last post by:
Hi, I've my win32 application which connecting to my sql database. till now i used MSDE as my database and now i want to upgrade to sql express 2005. after the upgrade i tried to connect to the...
3
by: Sebouh | last post by:
Hi guys. I'm completely new to databases, so i wanna ask you if this is achievable. I've been learning how to connect to an MS SQL database file with java. I've finally learned the basics,...
2
by: bobt1991 | last post by:
I just installed Microsoft Visual Studio 2008 Express edition, and it installs some sort of stripped down version of SQL Server. It comes with no tools for connecting to your "local" database,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.