Atonu Bhowmik

Greenhorn
+ Follow
since Nov 07, 2000
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Atonu Bhowmik

Hi Ashwin,
I think u r right and I appreciate your suggestion.
Thanks
Atonu
20 years ago
Hello Ashwin,
Thanks for everything.
Dear Ashwin, it will be very helpfull for me if you forward your e-mail ID so that in future ,I can take guideness from you.
My e-mail Id is smd@bom4.vsnl.net.in
Hope you will do it for me.
Thanks.
Atonu
20 years ago
Hello Ashwin,
Thanks for your valauable tips. Its really help me out.
I want to make one more request,How the different oracle user connect to the database.
How do I dynamically make the JDBC connection for each user from Applet.
Please suggest.

regards,
Atonu
20 years ago
Hello Ashwin,
Thanks for the tips, but I think Type-1 driver is the driver that can connect to any database and I have used this one.
Actually I want a user interface ie. applet and in backend the oracle database connected through jdbc-odbc bridge.
The user interface would have Add,delete,query etc button and on pressing buttons specific work has to be done.
My problem is where should I write the jdbc code ( in init(), start() or shall I create a instance of jdbc code in applet).
I am comfortable with applet and jdbc, but I struck when I integrate this two.
Please help me out,since I am new in Java.
waiting for your valuable assistance.
with regards,
Atonu Bhowmik
20 years ago
Dear Anup,
Java does'nt support global vaiable as such. As you know all the vaiables should be defined within a class. There are 4 specifier for accessing variables , and they are :
Given below a chart showing accesing level
Specifier Class Subclass package world
-------- ----- -------- ------- -----
private X
protected X X X
public X X X X
package X X
hope the above table help you out.

regards,
Atonu Bhowmik
20 years ago
Hello friends,
I want your help to solve the given below problem :
Friends, I want to query data from table using applet & jdbc. I have create a button and on pressing the button the query should execute.
The code is complied with no error but is not executing.
Please help me out.
Atonu Bhowmik

import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
public class japp extends Applet implements ActionListener
{
public String no="";
public String na="";
public String sl="";
public int x=0;
public Statement st;
public ResultSet rs;
public Connection cn;
public String msg = "";
public void init()
{
Button bt = new Button("Query");
add(bt);

bt.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{


String str = ae.getActionCommand();
if(str.equals("Query"))


{
try
{
st = cn.createStatement();
rs = st.executeQuery("select empno,ename,sal from emp where empno = 7934");

while(rs.next())
{
no = rs.getString("empno");
na = rs.getString("ename");
sl = rs.getString("sal");
//x++;
}
}
catch(SQLException e)
{
msg = e.getMessage();
}
}
repaint();
}

public void paint(Graphics g)
{
g.drawString(msg,60,60);
g.drawString(no,60,70);
g.drawString(na,120,70);
g.drawString(sl,200,70);

}
public static void main(String arg[])
{
japp jp = new japp();
jp.init();

try
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch (Exception e)
{
System.out.println("Class not found");
}
Connection cn = DriverManager.getConnection("jdbc dbc:ab_oracle","scott","tiger");
System.out.println("Connection established");
}

catch(SQLException e)
{
System.out.println("SQL Exception : "+e.getMessage());
}

}
}
20 years ago
Dear Monty,
First of all I will like to thanks for the interest shown on me.
But Let me tell u that the autocommit() is set false because the data is commited automatically which i don'nt want, but I have explicitly use commit() method which will make the changes in the database.
regards,
Atonu Bhowmik
Hello friend!
The problem may be with undefined resultset.After the connection follow the given below lines:
Statement st = cn.createStatement()
ResultSet rs1 = st.executeQuery("select * from *table name*");
while(rs.next())
{System.out.println(rs.getInt("field name"));
}
I hope this will solve the problem.
regards,
Atonu Bhowmik
[This message has been edited by Paul Wheaton (edited November 13, 2000).]
I want to delete a record through applet interface using jdbc and oracle8.
I am using stored procedure to delete records and which is executing fine in SQL prompt but when the same procedure is attached to java, the java code shows the record is deleted but it is not physically deleted from database.
The java code having proper database connection,Callable statement,Connection.Commit(),Connection.setAutocommit(false) method.
Please suggest.


------------------