pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: v j <jvs_a@yahoo.com>
To: pgsql-interfaces@postgresql.org
Subject: Re: JDBC APPLET Problem
Date: Thu, 1 Feb 2001 22:22:13 -0800 (PST)
Message-ID: <20010202062213.45650.qmail@web9506.mail.yahoo.com> (raw)
In-Reply-To: <Pine.LNX.4.21.0102012209190.24227-100000@gonzo.lnxsoftware.com.mx>

Dear Sir,
  Thanks you for everybody for advicing me..
  I've already tried to include both jdbc7.0-1.2.jar
and postgresql.jar  archive with my applet and then
copy the jdbc7.0-1.2.jar and postgresql.jar file into
public_html directory(which is the location of
SampleApplet.class file)  and try to run the applet
through web browser again and the error message still
shown "No suitable driver".. how should I do more 

Thanks you
J. V.

--- PostgreSQL Server
<postgres@gonzo.lnxsoftware.com.mx> wrote:
> On Thu, 1 Feb 2001, v j wrote:
> 
> > Dear Sir,
> >  Now I try to run the Java Program by using JDBC
> > PostgreSql through Web Browser.
> > I set the file pg_hba.conf as
> > 
> > local  all                                   trust
> > host   all   127.0.0.1   255.255.255.255     trust
> > host   all     0.0.0.0           0.0.0.0     trust
> > 
> > and the java code as shown below .....
> > 
> >  import java.sql.*;
> >  import java.applet.*;
> >  import java.awt.*;
> >  import java.awt.event.*;
> >  import java.net.*;
> >  import java.io.*;
> > 
> > 
> > public class SampleApplet extends Applet
> implements
> > ActionListener 
> > {
> >   	Connection conn;
> >   	Statement stmt;
> > 	String state_code;
> > 	
> >          private TextField Tinput;
> > 	private TextField Toutput;
> > 	private TextField Terror;
> >     
> >          private Button sqlprocess;
> > 	
> > 	
> >         
> >    public void init(){
> > 	   
> > 	   
> > 	   	try{ Class.forName 
> ("org.postgresql.Driver");}
> > 		catch(Exception ex){
> > 			ex.printStackTrace();}
> > 		
> > 		setFont(new Font("TimesRoman",Font.PLAIN,15));
> > 		setLayout(null);
> > 		
> > 		Label Linput = new Label("Enter a state code:
> ");
> > 		Tinput = new TextField(10);
> > 		Label Loutput = new Label("Sql Output");
> > 		Toutput = new TextField(30);
> > 		Terror = new TextField(100);
> > 		sqlprocess = new Button("SqlQuery");
> > 		
> > 		Linput.setBounds(10,30,150,30);
> > 		Tinput.setBounds(170,20,100,30);
> > 		Loutput.setBounds(10,80,100,30);
> > 		Toutput.setBounds(110,80,100,30);
> > 		Terror.setBounds(10,150,200,30);
> > 		sqlprocess.setBounds(50,210,80,30);
> > 		
> > 		add(Linput);
> > 		add(Tinput);
> > 		add(Loutput);
> > 		add(Toutput);
> > 		add(Terror);
> > 		add(sqlprocess);
> > 		
> > 		sqlprocess.addActionListener(this);
> > 
> >    }	      
> > 	   
> >    public void start() {
> > 	   try{ conn =
> >
>
DriverManager.getConnection("jdbc:postgresql://fmlhost.fml.t.u-tokyo.ac.jp/test","postgres","");
> > 			stmt = conn.createStatement();				
> > 	   }
> > 		catch(Exception ex){
> > 			
> > 			ex.printStackTrace();
> > 			Terror.setText(ex.getMessage());
> > 		        }			
> >    }	
> >    
> >     public void actionPerformed(ActionEvent ae) {
> >         
> > 	   if(ae.getActionCommand()=="SqlQuery"){
> >          
> > 	     
> > 		   state_code = Tinput.getText();
> > 		   
> > 		   try{ ResultSet res = stmt.executeQuery(
> "Select
> > name "+"From statename "+"Where code =
> > '"+state_code+"'");
> > 				if(res!=null)
> > 				while(res.next())
> > 					{String state_name = res.getString(1);
> > 					Toutput.setText(state_name);}
> > 		
> > 				res.close();
> > 				stmt.close();
> > 				conn.close();
> > 		   }
> > 		   
> > 		   catch(Exception ex){
> > 			   ex.printStackTrace(); }
> > 			
> > 		     
> >        }
> > 	   
> > 	}  
> >     
> >     
> > }
> > 
> > and I get the error message as
> > 
> > "No suitable driver"
> > 
> > Please advice me for this problem.
> > 
> > Thank you
> >   
> > 
> > 
> > __________________________________________________
> > Get personalized email addresses from Yahoo! Mail
> - only $35 
> > a year!  http://personal.mail.yahoo.com/
> > 
> 
> 
> 
> 
> Hello there :
> 
> You need to include your .jar archive with your
> applet
> 
> Just copy the jdbc jar to your applet directory 
> 
> 
> <html>
> <body
> <applet code=SampleApplet archive=jdbc7.0-1.2.jar 
> width=800 height=600>
> </applet>
> </body>
> </html>
> 
> 
> 
> 
> Saludos 
> 
> 
> Leonel
> 
> 


__________________________________________________
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/



view thread (13+ messages)  latest in thread

Message-ID: <20010202062213.45650.qmail@web9506.mail.yahoo.com>
Permalink:  ../20010202062213.45650.qmail@web9506.mail.yahoo.com/
Also on:    postgresql.org/message-id/20010202062213.45650.qmail@web9506.mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: jvs_a@yahoo.com
  Subject: Re: JDBC APPLET Problem
  In-Reply-To: <20010202062213.45650.qmail@web9506.mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox