Hi,
I am using java only
The code as follows:
Please give me some suggestions in solving this problem
Thanks & Regards,
Sankar
import java.applet.*;
import java.sql.*;
import java.text.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.applet.Applet.*;
import java.lang.*;
public class testdataapplet extends Applet implements ActionListener
{
TextField tf=new TextField(30);
TextField tf1=new TextField(30);
TextField tf2=new TextField(30);
TextField tf3=new TextField(30);
Label l1=new Label("Enter Your Staff no:");
Label l2=new Label("Employee Name:");
Label l3=new Label("Department Name:");
Label l4=new Label("Mail-id:");
Button b=new Button("submit");
String s;
TextArea output;
public void init()
{
output=new TextArea(10,20);
add(l1);
add(tf);
add(l2);
add(tf1);
add(l3);
add(tf2);
add(l4);
add(tf3);
add(output);
add(b);
b.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource().equals(b))
{
s=tf.getText();
try
{
//DriverManager.registerDriver( new
oracle.jdbc.driver.OracleDriver() );
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection
con=DriverManager.getConnection("jdbc:oracle:thin:[EMAIL PROTECTED]:1521:edb");
output.appendText("connected\n");
Statement stmt=con.createStatement();
ResultSet rset=stmt.executeQuery("select * from empno where
empno='"+s+"' ");
while(rset.next())
{
output.appendText(rset.getString(1) +
"\t" +rset.getString(2)+"\n");
tf1.setText(rset.getString(2));
tf2.setText(rset.getString(3));
tf3.setText(rset.getString(4));
}
}
catch (Exception e)
{
output.appendText(e.getMessage());
}
}
}
}
On Wed, 20 Feb 2002, Liu, Roger (R.) wrote:
> First, need you clarify:
>
> 1: Do you use Java or JavaScript
> 2: How you program to access Database
>
> Roger Liu
> -----Original Message-----
> Sent: Wednesday, February 20, 2002 1:53 AM
> To: Multiple recipients of list ORACLE-L
>
>
>
> Hi,
> I am new to this group as well as to Oracle.
> I have installed Oracle 8.1.5 & Java 1.3.1_02 on Solaris system.
> My question is whatever JDBC drivers that are installed by default
> supports the java version 1.3.1_02 or i have to install JDBC drivers
> seperately.I am facing lot of problems in connecting to Database from java
> script.Please clarify my doubt.
>
> Thanks & Regards,
> Sankar
>
>
>
>
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: P.V.Sankar
> INET: [EMAIL PROTECTED]
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Liu, Roger (R.)
> INET: [EMAIL PROTECTED]
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: P.V.Sankar
INET: [EMAIL PROTECTED]
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
San Diego, California -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).