tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dave.pr...@bt.com
Subject RE: Tomcat and Access Database
Date Mon, 30 Apr 2001 16:40:16 GMT
The same as jswdk

> -----Original Message-----
> From:	Sridevi Kumar [SMTP:Sridevi.Kumar@entrust.com]
> Sent:	30 April 2001 17:26
> To:	'tomcat-user@jakarta.apache.org'
> Subject:	RE: Tomcat and Access Database
> 
> That's what i am asking ,Kindlt tell me the codes for accessing servlets
> with JDBC from tomcat. 
> 
> -----Original Message----- 
> From: dave.prout@bt.com [ <mailto:dave.prout@bt.com>] 
> Sent: Monday, April 30, 2001 12:23 PM 
> To: tomcat-user@jakarta.apache.org 
> Subject: RE: Tomcat and Access Database 
> 
> 
> I didn't make any changes to web.xml for database access. I also developed
> 
> on JSWDK and ported to Tomcat, but I had no problems, i.e. the Access 
> Database sql ran just the same. 
> 
> David 
> 
> > -----Original Message----- 
> > From: Sridevi Kumar [SMTP:Sridevi.Kumar@entrust.com] 
> > Sent: 30 April 2001 16:51 
> > To:   'tomcat-user@jakarta.apache.org' 
> > Subject:      RE: Tomcat and Access Database 
> > 
> > Actually I am connecting to jdbc through servlets for retrieving 
> > information of employee skillsets. 
> > It is working coolly with jsdk but i don't know how to make it work with
> 
> > tomcat server. 
> > I want to know the configuration to set it in tomcat Server.xml file and
> 
> > web.xml file. 
> > 
> > -----Original Message----- 
> > From: dave.prout@bt.com [ < <mailto:dave.prout@bt.com>>] 
> > Sent: Monday, April 30, 2001 11:11 AM 
> > To: tomcat-user@jakarta.apache.org 
> > Subject: RE: Tomcat and Access Database 
> > 
> > 
> > what is the value of query ? 
> > 
> > > -----Original Message----- 
> > > From: Sridevi Kumar [SMTP:Sridevi.Kumar@entrust.com] 
> > > Sent: 30 April 2001 15:54 
> > > To:   'tomcat-user@jakarta.apache.org' 
> > > Cc:   Sridevi Kumar 
> > > Subject:      Tomcat and Access Database 
> > > 
> > > Hello, 
> > > I am Using Access Database to connect with JDBC in Java and my program
> 
> > > looks like this... 
> > > 
> > > public class ...{ 
> > > .............. 
> > > ................ 
> > > ............... 
> > > 
> > > try{ 
> > > Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); 
> > > con=DriverManager.getConnection("jdbc:odbc:shree"); 
> > > }catch(Exception e){ 
> > > e.printStackTrace(); 
> > > System.exit(1); 
> > > } 
> > > 
> > > try{ 
> > >        
> > >         stmt=con.createStatement(); 
> > >         ResultSet rs=stmt.executeQuery(query); 
> > >         ResultSetMetaData rsmd=rs.getMetaData(); 
> > >         System.out.println(""); 
> > >         out.println("<font color=gray>"); 
> > > out.println("<u><b>"+"The Developers with " +level+ " Skill level
in 
> > > "+softwarename + " is/are :"+"</b></u>"); 
> > > out.println("</font>"); 
> > > out.println("<hr border=2 color=midnightblue>"); 
> > >         out.println("\n"); 
> > >         out.println("<br>"); 
> > >         int no_column=rsmd.getColumnCount(); 
> > >         for(int i=1;i<=no_column;i++){ 
> > >                 if(i>1) out.print(","); 
> > >                 String columnnames=rsmd.getColumnName(i); 
> > >                 out.print("<B>"+columnnames+"\t\t"+"</b>"); 
> > >                 } 
> > >                 out.println("<br>"); 
> > >                 
> > >                 while(rs.next()) { 
> > >                 for(int i=1;i<=no_column;i++){ 
> > >                 if(i>1) out.print(","); 
> > >                 String columnValue=rs.getString(i); 
> > >                 out.print(columnValue+"\t\t"); 
> > >                 } 
> > >                 out.println("<br>"); 
> > >                 } 
> > >                 stmt.close(); 
> > >                 con.close(); 
> > >                 }catch(java.sql.SQLException e){ 
> > > System.out.println(e.toString()); 
> > > } 
> > > out.close(); 
> > > } 
> > > } 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > Please help me to connect this program to Tomcat and work from tomcat 
> > > server. 
> > > It's very urgent... 
> > > 
> > > Thank You. 
> > > 
> > 
> 

Mime
View raw message