connecting servlet to db2

connecting servlet to db2

View Answers

October 6, 2008 at 8:54 PM

If u are using the oracle Database 9i(connect from servlet)
1)first u have to load the drivers.
2)Get the connection to the DataBase.
3)In this process first you have to set the classpath for oracle9i ie classes111.jar file in the classpath.
4)copy the abou said jar file in lib folder along with servlet-api.jar and jsp-api.jar files.

for example code like this if u are using the oracle type4(thin) driver:
import java.sql.*;

Class.forName("oracle.jdbc.driver.OracleDriver");

Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:serviceid","scott","tiger");
5)to know the serviceid use type this command in oracle9i ie
select * from global_name;
the first word in this name is service id otherwise to search for tnsNames.ora file in oracle software after installation. I think it is in jdbc folder.









Related Tutorials/Questions & Answers:
connecting servlet to db2 - JSP-Servlet
connecting servlet to db2  Hello sir, Iam new to db2.so I would like to know the procedure to connect to db2 from a servlet or jsp.Also Tell me the configuration we need to be done before connecting to the db2(such as what path
DB2
DB2  Actually i want to store Live Video Streaming(from Camera) in data base(DB2) & also i want to retrieve the stored video from client(Authorized Person). So Please send me the java code for above functions
Advertisements
connecting jsp to mysql - JSP-Servlet
connecting jsp to mysql  Hi, i am working on 'Web application development' project that uses JSP, MySQL and tomcat.i am not able to connect to the mysql database through jsp. After downloading the mysql-connector-java-5.0  
connecting to a database dynamically - JSP-Servlet
connecting to a database dynamically   abc.html :- abc.jsp :- Above code gives the following exceptions :- type Exception report message description The server
Connecting to Database from a hyperlink in JSP - JSP-Servlet
Connecting to Database from a hyperlink in JSP  How can I connect to database by clicking on a hyperlink in a JSP Page.Can you please give me sample code for that? Thanks, Srinivasa Rao  Hi friend, insert code
jsp connection to db2
jsp connection to db2  hello friends i have a project to do in jsp using db2 database can anyone please help me in connecting a jsp page to db2 database?? please frienda help me
Hibernate db2
In this section, you will learn about the db2 configuration in Hibernate
ModuleNotFoundError: No module named 'db2'
ModuleNotFoundError: No module named 'db2'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'db2' How to remove the ModuleNotFoundError: No module named 'db2' error
DB2 - Development process
DB2  Actually I am participating in IBM's greatming challenges competition. I am using IBM's DB2 for database purpose. I don't know how to connect to database(DB2) from jsp application.I am using eclipse as an IDE. I am
Hibernate 5 DB2 Dialect
Hibernate 5 DB2 Dialect  Hi, What is Hibernate 5 DB2 Dialect? How to use Hibernate 5 DB2 Dialect in Hibernate? Thanks   Hi, You should add following into the hibernate application configuration: <property
Hibernate 5 DB2 Dialect
Hibernate 5 DB2 Dialect  Hi, What is Hibernate 5 DB2 Dialect? How to use Hibernate 5 DB2 Dialect in Hibernate? Thanks   Hi, You should add following into the hibernate application configuration: <property
Null pointer exceptation-Java Servlet web application,Problem connecting with MYSQL database
Null pointer exceptation-Java Servlet web application,Problem connecting with MYSQL database  Hi everyone i would like to ask few question here,since i try to configure this out for 1 week,i dont find any solution for my problem
Need a query to run in db2
Need a query to run in db2  hi all, I need a query to run in DB2 for the following: Table 1- MARKETINGACCOUNTS Fields-ACCOUNTTYPE,Accountnumber; Table 2- ACCOUNTS Fields-LEDGERCODE,ACCOUNTNUMBER,BALANCE FROM THE ABOVE I NEED
connecting databases
connecting databases  I need to connect mysql on 2 or more remote pc'c. how can i giv the ip address for 2 or more systems. is it possible to connect to the required systems by user specifying the database and table name my
connecting to timesten in web application
connecting to timesten in web application  Please give me the steps connecting to timesten in web application. Am using jsp
servlet and jsp
servlet and jsp  how to connect an jsp and an servlet without connecting to database
Connecting to a database through the Proxy.
Connecting to a database through the Proxy.  Connecting to a database through the Proxy I want to connect to remote database using a program that is running in the local network behind the proxy. Is that possible
java connecting frames
java connecting frames  how to connect one frame to another frame by using awt or swings?`print("code sample
connecting with database - Struts
connecting with database  I am creating an application where when jsp page is displayed, it contains the combo box where data is populated from the database.it has 3 buttons and the functionality for all buttons is different
storing images in directory,saving path in db2
storing images in directory,saving path in db2  i am working in a web... in a folder and its path(relative/absolute) in my DB2 database. and when.... can you help?? i'm using DB2 databse Linux(fedora 13) environment
Connecting code of reset password to database
Connecting code of reset password to database  connecting code of reset password to database
Connecting to Hardware - Java Beginners
Connecting to Hardware  I'm currently using netbean for my Final Year Project system that involve some hardware like electronic weighihng scale. Can you please provide me at least the idea if not the coding on how the system can
connecting to database - Struts
connecting to database  Hi I am having problems with connection to MS SQL Server 2005 database. My first is what do i write in struts-configuration.xml file that enable me to use methods in the model class to display
jsp -sevlet connecting to database using dropdown
jsp -sevlet connecting to database using dropdown  How can I get my... am thinking of a form that links to a servlet and the servlet connects... to a servlet which then inserts to the database. someone please give me some sample
Connecting to MYSQL Database in Java
Connecting to MYSQL Database in Java  I've tried executing the code below but the error that I get is "Error: com.mysql.jdbc.Driver" I downloaded the connection driver and configured the class path but the error persists. Please
XML to DB2 Comparison using Java xpath
XML to DB2 Comparison using Java xpath  Hi , I am a manual tester by profession , i have a huge xmls file (1 GB) containing product details of 'n' products . i want to compare these xml values with db2 using Java. I have Good
Connecting JTable to database - JDBC
Connecting JTable to database  Hi.. I am doing a project on Project Management System for which i created the user interfaces.. I have a user interface in which i have used JTables.. Now my problem is I dont know how to how
java connecting to oracle db
java connecting to oracle db  PLZ SAY ME HOW TO INSERT THE VALUES INTO ORACLE THIS IS THE CODE: import java.io.*; import java.sql.*; import java.awt.*; import javax.swing.*; import java.awt.event.*; import
connecting to access database
connecting to access database  print("code sample");Hi I Write java projrame in notepad,I use 3 notepad pages to write this program,when i run this there is no error but my data is not going to my Acess Database. There is working
Connecting Oracle database with struts - Struts
Connecting Oracle database with struts  Can anyone please provide me some solutions on Connection between Oracle database and struts
Connecting to Unix through Java - JavaMail
Connecting to Unix through Java  Could you please tell a sample code, where i connect to the unix server and run a script and write the results in a file and mail that file back to me
Connecting jboss with sql 2005 - Struts
Connecting jboss with sql 2005  Hai, i have project that was developed in struts,backed is sqlserver 2005 and and i am using jboss. I want to connect another database (sqlserver 2005) with my project.could u please help me
Problems connecting to a database. Java/SQLite
Problems connecting to a database. Java/SQLite  `print("try { con = DriverManager.getConnection("jdbc:sqlite:db/Freepark.sqlite"); } catch... on an SQL database but i am having problems connecting to it, I think the problem
problem in connecting clients - Development process
problem in connecting clients   i had coded programe to establish the lan based chat application but the server listening to only one client at a time it not receiving the messages form allclients would tell me the solution  
Servlet
Servlet  What is Servlet
java jdbc connecting probelm - JDBC
java jdbc connecting probelm  import javax.servlet.*; import javax.servlet.http.*; import javax.sql.*; import java.io.*; public class ECom extends HttpServlet { String name,pass; public void doPost
code for connecting reset password code to database.
code for connecting reset password code to database.  code for connecting reset password code to database.   Hello Friend, Do you want to change your password and update the password to database
Servlet
Servlet  how to navigate one servlet page to another servlet page
java connecting to oracle db - JDBC
java connecting to oracle db  how to connect oracle data base with java application?  Hi Friend, Follow these steps: 1) Import the following packages in your java file:*********** import java.sql.*; import
doubt in connecting to mysql in flex - XML
doubt in connecting to mysql in flex  The ?Create application from database? is a Flex 3 feature that enable you to create simple applications in few clicks;Here is an example whichusephp as back-end and MySql as DataSource:First
doubt in connecting mysql in flex - XML
doubt in connecting mysql in flex  The ?Create application from database? is a Flex 3 feature that enable you to create simple applications in few clicks;Here is an example whichusephp as back-end and MySql as DataSource:First
Connecting to remote mysql server using jdbc.
Connecting to remote mysql server using jdbc.  How to Connect to remote mysql server using jdbc
Connecting different Servers - Java Server Faces Questions
Connecting different Servers  How can i connect two different tomcat server in an application
servlet
servlet  is there any way to include pdf's in servlet
servlet
servlet  How many times the servlet is accessed
servlet
servlet  what are the methods and interfaces in the servlet api ?   Servlet Tutorials
connecting to ssh using ir00co and postgres - Struts
connecting to ssh using ir00co and postgres  how can i connect to this servers after i succesfully login in the ldap?will i open new connection?any advice will be appreciated... ebok
servlet
servlet  what are the all necessary configuration to run a servlet
servlet
servlet  how to interact with a servlet from a swing program
servlet
servlet  I designed 1 html form & a servlet but when I click on form I don't get output of servlet Please help

Ads