venkat

Greenhorn
+ Follow
since Jan 23, 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 venkat

please send the connection code for all 4 drivers.
this is the code:
import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
public class GetRecords
{
public static void main(String [] args) throws SQLException
{
DriverManager.registerDriver(new sun.jdbc.odbc.JdbcOdbcDriver());
Connection con=DriverManager.getConnection("Jdbc dbc:vendsn1","scott","tiger");
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery(" select * from department");
ResultSetMetaData rsmd=rs.getMetaData();
boolean b = rsmd.isSearchable(1);
while(rs.next())
{
System.out.println(rs.getRow());
System.out.println(rs.getInt(1));
System.out.println(rs.getString(2));
System.out.println(rs.getString(3));
System.out.println(rsmd.getColumnCount());
System.out.println(rsmd.getColumnDisplaySize(1));
System.out.println(rsmd.getColumnDisplaySize(2));
System.out.println(rsmd.getColumnDisplaySize(3));
System.out.println(rsmd.getColumnTypeName(1));
System.out.println(rsmd.getTableName(1));//to get the table name
System.out.println("-------");
}
rs.close();
stmt.close();
con.close();
}
}
this is the code

import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
public class GetRecords
{
public static void main(String [] args) throws SQLException
{
DriverManager.registerDriver(new sun.jdbc.odbc.JdbcOdbcDriver());
Connection con=DriverManager.getConnection("Jdbc dbc:vendsn1","scott","tiger");
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery(" select * from department");
ResultSetMetaData rsmd=rs.getMetaData();
boolean b = rsmd.isSearchable(1);
while(rs.next())
{
System.out.println(rs.getRow());
System.out.println(rs.getInt(1));
System.out.println(rs.getString(2));
System.out.println(rs.getString(3));
System.out.println(rsmd.getColumnCount());
System.out.println(rsmd.getColumnDisplaySize(1));
System.out.println(rsmd.getColumnDisplaySize(2));
System.out.println(rsmd.getColumnDisplaySize(3));
System.out.println(rsmd.getColumnTypeName(1));
System.out.println(rsmd.getTableName(1));//to get the table name
System.out.println("-------");
}
rs.close();
stmt.close();
con.close();
}
}
15 years ago
converting string to array object
15 years ago
how to move text from one jtext to other jtext
15 years ago
how to synchrinize threads in java
15 years ago
how to move text in the one jtextbox to other jtextbox
15 years ago
may be im giving it after long time .. U try to do applet-jdbc communication with applet -servlet communication.. It will solve ur problem i hope.. Do the database part in the servlet and send the data to the applet...

venkat
19 years ago
hi friends i need ur help.
I want to send object from the applet to the servlet. Here im pasting the code and im finding problem while transferring the data .. Im getting java.io.InterruptedIOException while reading the data in the servlet.Please help me to resolve the problem..

Code in the applet:
try{
AppletContext ac = this.getAppletContext();
URL dataDBservlet = new URL(this.getCodeBase(),"/servlet/CallServlet");
URLConnection servletConnection = dataDBservlet.openConnection();
servletConnection.setUseCaches(false);
servletConnection.setDoInput(true);
servletConnection.setDoOutput(true);
servletConnection.setRequestProperty ("Content-Type", "application/octet-stream");
ObjectOutputStream oos = new ObjectOutputStream (servletConnection.getOutputStream());
Vector vc = new Vector();
vc.addElement(timeSheetData);
oos.writeObject(vc);
ac.showDocument(dataDBservlet);
oos.flush();
oos.close();
}catch(Exception e){
System.out.println("Error in capplet.java "+e);
}
Im not facing any problem here.Its calling the servlet.

Servlet Code:
public void doGet(HttpServletRequest req,HttpServletResponse res) throws IOException,ServletException{
res.setContentType("application/octet-stream");
PrintWriter out = res.getWriter();
System.out.println("stage 1:");
Vector v = new Vector();
inputFromApplet = new ObjectInputStream ( req.getInputStream());
System.out.println("stage 2:");
v = (Vector) inputFromApplet.readObject();
inputFromApplet.close();
}catch(InterruptedIOException iex){
System.out.println("Error in Call servlet :"+iex);
}catch(Exception e){
System.out.println("Error in CallServlet "+e);
}
Here im getting output in webserver Stage :1
and printing java.io.InterruptedIOException

Please put ur ideas and send me as soon as posible.

venkat
19 years ago
Hi
I am tryng to position scrollbar at a particular position other than the default position.
I designed an applet in which I have a scrollpane.. to that scrollpane I'm adding a panel that is child to the above said scrollpane. The problem I'm facing is the size of the child panel is around 1900. I want to place my scrollbar position in between .i.e. around 900. For this I'm using setScrollPosition() method in the init().. but itz not working. Please help me urgently.
19 years ago