Article View: cn.bbs.comp.lang.java
Article #21757����
From: zxylonely
Date: Mon, 17 Nov 2003 11:25
Date: Mon, 17 Nov 2003 11:25
38 lines
2032 bytes
2032 bytes
��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() ;
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
������ĩ���£�
--
[m[1;36m�� ��Դ:������δ��վ bbs.pku.edu.cn��[FROM: 202.112.135.229][m
Technical Details
Message-ID:
<49IbHA$AKV@bbs.pku.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!PKUShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,GB X-Google-Thread: f6cb0,17bc285acf6c7e0f,start X-Google-Attributes: gidf6cb0,public X-Google-ArrivalTime: 2003-11-17 03:26:11 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!PKU From: zxylonely@bbs.pku.edu.cn (zxylonely) Newsgroups: cn.bbs.comp.lang.java Subject: ���� Date: 17 Nov 2003 11:25:55 GMT Organization: ����δ��վ Message-ID: <49IbHA$AKV@bbs.pku.edu.cn> Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 8bit X-Filename: Java/M.1069068346.A Lines: 38