this is the line where iam getting error
db.save();
plz tellme actually when such(in what cases) errors comes
thanx
Shashi
On Thu, 06 Dec 2001 Chen, Gin wrote :
> It would be helpful if u look at the line number from
> where ur error is
> occuring. Without looking further into ur code, I would
> guess that it is
> probably in this method:
>
> public UpdateChildCountStand(int count)throws Exception
> {
> db = new DBTransaction();
> con = db.getConnection();
> //con.setAutoCommit(false);
> java.util.TimeZone indiaZone =
> java.util.TimeZone.getTimeZone("GMT+5:30");
> df = DateFormat.getDateInstance(DateFormat.DATE_FI-
> ELD);
> df.setTimeZone(indiaZone);
> strdt = df.format(new java.util.Date());
> Connection con = db.getConnection();
> }
>
> Why is that last line there?
> -Tim
>
> -----Original Message-----
> From: shashi kanth goud [mailto:[EMAIL PROTECTED]
> ]
> Sent: Thursday, December 06, 2001 10:06 AM
> To: [EMAIL PROTECTED]
> Subject: java.sql.SQLException
>
>
> hi all,
> here is my code iam using sqlserver
> iam getting following error
> Exception java.sql.SQLException: [Atinav][JDBC SQL
> Server Driver] Address
> already in use: connect
> plz plz tell where iam wrong
> //package infiniteopps.WebWizard;
> import infiniteopps.WebWizard.*;
> import infiniteopps.db.local.DBTransaction;
> import java.sql.*;
> import java.io.*;
> import java.text.*;
> public class UpdateChildCountStand
> {
> String name;
> public DBTransaction db;
> Connection con;
> Statement stat;
> DateFormat df;
> String strdt;
> public static void main(String[] args)throws
> Exception
> {
> try{
> UpdateChildCountStand uc = new
> UpdateChildCountStand(1);
> uc.check("raja0001");
> uc.close();
> }
> catch(Exception e)
> {
> Log1.out("Exception "+e);
> }
> System.in.read();
> }
> public UpdateChildCountStand(int count)throws Exception
> {
> db = new DBTransaction();
> con = db.getConnection();
> //con.setAutoCommit(false);
> java.util.TimeZone indiaZone =
> java.util.TimeZone.getTimeZone("GMT+5:30");
> df =
> DateFormat.getDateInstance(DateFormat.DATE_FIELD);
> df.setTimeZone(indiaZone);
> strdt = df.format(new
> java.util.Date());
> Connection con =
> db.getConnection();
>
> }
>
> public int check(String id)throws Exception
> {
> //Log1.out("check begin");
> int intleft=0,intright=0;
> if(id.equals("null"))
> return 0;
> //Log1.out("aaaaa begin");
> //ResultSet rs = db.getResult("select
> CustNo from
> CustHeadSide where HeadNo ='" + id +"' and side='l'");
>
> Statement stat = con.createStatement();
> ResultSet rs = stat.executeQuery("SELECT
> CustomerDetls.CustNo
> FROM CustomerDetls INNER JOIN CustomerMaster ON
> CustomerDetls.CustNo =
> CustomerMaster.CustNo where HeadNo ='" + id +"' and
> CustomerMaster.Type='l'");
>
> if(rs.next())
> {
> String tmp = rs.getString(1);
> rs.close();
> stat.close();
> Log1.out("\nleft "+tmp);
> intleft += check(tmp)+1;
> }
> else
> check("null");
> //ResultSet rs1 = db.getResult("select
> CustNo from CustHeadSide
> where HeadNo ='" + id +"' and side='r'");
> //Log1.out("bbbbb begin");
> stat = con.createStatement();
> ResultSet rs1 = stat.executeQuery("SELECT
> CustomerDetls.CustNo
> FROM CustomerDetls INNER JOIN CustomerMaster ON
> CustomerDetls.CustNo =
> CustomerMaster.CustNo where HeadNo ='" + id +"' and
> CustomerMaster.Type='r'");
> if(rs1.next())
> {
> String tmp = rs1.getString(1);
> rs1.close();
> stat.close();
> Log1.out("\nright "+tmp);
> intright +=check(tmp)+1;
> }
> else
> check("null");
> rs1 = db.getResult("select CustNo from
> custChCount1 where
> CustNo='"+id+"'");
> //Log1.out("custChCount begin");
> if(rs1.next())
> {
> db.setTable("custChcount1");
> db.setFields("rightchild",
> intright);
> db.setFields("leftchild",
> intleft);
>
> //db.setFields("checkbit",0);
> db.setWhere("CustNo",id);
> db.update();
> //db.closeConnection();
> Log1.out("\nupdated ");
> }
> else
> {
> db.setTable("custChcount1");
> db.setFields("CustNo",id);
> db.setFields("rightchild",
> intright+"");
> db.setFields("leftchild",
> intleft+"");
> db.save();
> Log1.out("\nsaved "+strdt);
> }
> rs1.close();
> return intright+intleft;
> }
>
>
>
>
>
> ________________________________________________________-
> ___________________
> To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet--
> interest.html
> Resources: http://java.sun.com/products/servlet/external-
> -resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.ht-
> ml
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html