Re: help with JDBC

From: steve (me_at_me.com)
Date: 09/12/04


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

 



Relevant Pages

  • statement.executeUpdate(String sql) - not inserting results in correct order
    ... I am trying to insert the values of a resultset into an oracle ... particular table in a SQL server database, ... and then inserting that data from resultset into an oracle ... GRDPRODPWRMAX, GRDPRODPWRMIN," + ...
    (comp.lang.java.databases)
  • Re: What so special about PostgreSQL and other RDBMS?
    ... That's exactly the link the licence agreement for the database points to when it ... comes to what wecan expect for paying support. ... > "Oracle may provide additional releases or versions of its programs ... If the requirements are volatile I'd do a long term contract detailing what ...
    (comp.lang.php)
  • Re: Are there performancebenefits to reorganizing database-using export/import?
    ... time we had done full export of 8.1.7 database and then created 9.2. ... those warnings are well defined in "Expert Oracle Database ... What happens if you accidentally change the character set when you ... exactly 30 characters long with an empty set character in the column ...
    (comp.databases.oracle.server)
  • A cool DBA job wanted
    ... 7, Oracle 6, Sybase, SQL Server ... Proposed proactive database monitoring through ... strategies to administer remote Oracle databases ... Trained installation and support personnel in basic ...
    (comp.databases.oracle.server)
  • Re: I want to add to myknowledge
    ... 7, Oracle 6, Sybase, SQL Server ... Oracle Database Administrator ... Trained installation and support personnel in basic ... Senior Oracle Database Administrator ...
    (comp.databases.oracle.server)