JDBC and ORACLE

From: sumit9554 <sumit9554_at_my-deja.com>
Date: Sat, 25 Mar 2000 19:33:04 GMT
Message-ID: <8bj49g$4jt$1_at_nnrp1.deja.com>



Hi:

I have a created a table using JDBC statment as:

stmt.execute ("create table basic_table (mnum int, x char(50))");

Now I want to insert data into the 2nd column of the table from a string variable.

The variable 'data' is of type String in Java.

How do I pass the argument to the stmt.execute command? Can I say as follows?

           String insertcommand = "insert into basic_table values (3,'";
           insertcommand.concat(data);
           insertcommand.concat("')");

and then say
stmt.execute(insertcommand);

I tried the above and I still cannot get the data to go in to the database.

Oracle has the following syntax for inserting data: insert into basic_table values (3,'datadatadata');

I would eventually want to have the second column of the table of type long ( a character datatype capable of storing large amounts of text) instead of char[50].

Can somebody suggest what I might be doing wrong and how to fix it? Thanks
smit

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Sat Mar 25 2000 - 20:33:04 CET

Original text of this message