🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.lang.java
Article #21759

Re: ����

#21759
From: ��������
Date: Mon, 17 Nov 2003 12:12
57 lines
2661 bytes
�� �� zxylonely@bbs.pku.edu.cn (zxylonely) �Ĵ������ᵽ: ��
: ��  ��: ����
: ����վ: ����δ��վ (Mon Nov 17 19:25:55 2003)
: ת��վ: NanKai!news.happynet.org!PKU
: 
: ��oracle ��ݿ�
: ��������
: package condb;
: import java.sql.*;
: import java.lang.*;
:  public class condb {
:     public static void main(String[] args)
:     {
:       try {
:         Class.forName("oracle.jdbc.driver.OracleDriver");
:         String StrURL="jdbc:oracle:thin:@zz:1521:oradb";
:         String user="zxy";
:         String pwd="zxy";
:         Connection Dbcon=DriverManager.getConnection(StrURL,user,pwd);
:         System.out.print("���� success!");
:         Statement Stat=Dbcon.createStatement() ;
:         ResultSet result=Stat.executeQuery("select * from zxytesttbl");
/*
:         result.last()  ;
:         int w =result.getRow() ;
*/
�ij����������ԣ�
          int w = 0;
          if(result.next())
            {
                result.last();
                w = result.getRow();
            }
//�Ǻǣ����еĻ�����while��result.next()) w++;

:         System.out.println("the resultset have " + w + " rows");
:         Dbcon.close();
:       }
:       catch (ClassNotFoundException e){
:       System.out.println(e);
:       }
:       catch (SQLException sqle){
:         System.out.println(sqle);
:       }
:     }
: }
: ����ݿ������ϣ��������ܼ�¼��ʱ���?������Ϣ���£�
: ���� success!
: java.sql.SQLException: ��ֻת��������Ч����: last
: ������ĩ���£�
: 
: --
: �� ��Դ:������δ��վ bbs.pku.edu.cn��[FROM: 202.112.135.229]


--
�� ��Դ:���Ұ��Ͽ�վ bbs.nankai.edu.cn��[FROM: 202.113.30.129] 
Technical Details
Message-ID: <49IcMM$9mS@bbs.nankai.edu.cn>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newshosting.com!news-xfer2.atl.newshosting.com!167.206.3.103.MISMATCH!news3.optonline.net!maily.cic.tsinghua.edu.cn!news.happynet.org!NanKai

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f6cb0,fea505f29ba10da7,start
X-Google-Attributes: gidf6cb0,public
X-Google-ArrivalTime: 2003-11-17 04:13:09 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newshosting.com!news-xfer2.atl.newshosting.com!167.206.3.103.MISMATCH!news3.optonline.net!maily.cic.tsinghua.edu.cn!news.happynet.org!NanKai
From: desertwolf.bbs@bbs.nankai.edu.cn (��������)
Newsgroups: cn.bbs.comp.lang.java
Subject: Re: ����
Date: 17 Nov 2003 12:12:05 GMT
Organization: �Ұ��Ͽ�վ
Message-ID: <49IcMM$9mS@bbs.nankai.edu.cn>
X-Filename: Java/M.1069070902.A
Lines: 57