Re: help with JDBC
From: steve (me_at_me.com)
Date: 09/12/04
- Next message: Tony Morris: "Re: store whole InputStream in a String"
- Previous message: Tony Morris: "Re: Build using Ant gets Stuck"
- In reply to: Ebrahim: "Re: help with JDBC"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 12 Sep 2004 09:54:34 +0800
On Sun, 12 Sep 2004 00:34:27 +0800, Ebrahim wrote
(in article <c5a5cacc.0409110834.1adf6edf@posting.google.com>):
> "Steve Cassidy" <steven@cassidy.co.united_kingdom> wrote in message
> news:<H8A0d.4880$Ry6.51341315@news-text.cableinet.net>...
>> "Ebrahim" <ebrahimbandookwala@hotmail.com> wrote in message
>> news:c5a5cacc.0409110201.40579a85@posting.google.com...
>>> hi guys .. I am using Oracle : JDBC driver to connect to an oracle
>>> It gives the Exception ResultSet.next() was not called .
>>> BEsides why should ResultSet.Next() be called in the first place ??
>>
>> rs.next() reads a row from the database into the ResultSet. When you first
>> create a ResultSet with statement.executeQuery() or similar, the cursor
>> into
>> the ResultSet is initially positioned at the start, before the first row.
>> Your first call to rs.next() reads the first row - you have to call it even
>> if your query returns only one row. Until you've called this you can't
>> retrieve any values, as there aren't any loaded to retrieve.
>
> thx for clearing that doubt !!!
>
> could you also help me with the following :
> i need to enter values into my Oracle db in chinese . For this I need
> to set up the Oracle DB in chinese . Since I work for a company , they
> might not allow me to change the charset for the entire database to
> UTF-8 but rather only for a specific schema . Can you help me with
> this ?? Do you know of any other way by which I can enter data in
> Chinese/Japanese in an ORacle DB ??
>
> Ebrahim B
O.K here we go again.
you need to read up on oracle multi character support, it has improved since
UTF-8
(see the rather long running thread i18n'ed characters set in DBMS and
tables) in this new group.
you can support any multi byte language, chinese/japanese in an oracle
database.
if using oracle , YOU MUST ensure your Schema represents the character
encoding data you are entering into it. ( yes you CAN get away with sticking
multibyte data into a normal clob/varchar2)
but be aware on pl/sql string functions, if you use the wrong encoding ( by
sticking multibyte into single byte tablespace) you will SERIOUSLY mess up
the string functions , and the text indexing functions. if you heed to get 1
character or a bunch of characters.
also oracle will try to do character tanslation between the database & the
client.
however if you like to live dangerously, loose upgradeability and don't mind
loosing string indexing ( or your job):
you can try the following:
1. get your java app to input ALL the asian text.
Build a binary storage area.
delimit the asian text (somehow), concat the resulting Objects
insert your "asian" Objects into a binary staging area.
write the staging area to oracle & store it in a BLOB ( binary large object)
( oracle will not index or try to do character translation, do not use a
CLOB)
when you need the asian text , get the BLOB from the database, unpack the
data, & display it on your screen.
( do not try to get smart , and realize that you can use java in the database
to "serialize objects", then try to call the server code from the client
java, to serialize the data , to & from the database, if you do the overhead
will buy your database)
Be aware that you are fooling yourself & the database , by doing the above.
( if you have to add fields/remove fields from your data, or make fields
longer/smaller, then you better be sure your packing/unpacking routines are
smart enough)
steve
- Next message: Tony Morris: "Re: store whole InputStream in a String"
- Previous message: Tony Morris: "Re: Build using Ant gets Stuck"
- In reply to: Ebrahim: "Re: help with JDBC"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|