text « Operation « Java Database Q&A





1. Reading Data from ASCII text file and inserting in database    coderanch.com

Hi Friends, I am have an ASCII text file containing records.I am reading one record at a time using BufferedReader.readLine(); Then i am reading each dataitem into a StringBuffer from the record as there is a delimiter present after each dataitem. Now i am unable to typecast the dataitem with that of the field in the database? here is my code: ...

2. JDBC querying Chinese text    coderanch.com

Hello, Specs ========= JDK 1.3.1 Oracle 8 w/ Big5 encoding used both thin driver and thick driver I am trying to query from a column that has Chinese (Big5) text. select * from product where prodName = 'xyz' // xyz represents big5 chars. When I do a select from Toad or SQL Plus, I can grab the rows. When I do ...

3. problem with inserting formatted text    coderanch.com

4. Loading queries from text file    coderanch.com

6. Failed to insert text with quotes    coderanch.com

Hi all, Im unable to insert text data into a table when the text im trying insert has quotes. Ex: String sql1="INSERT into project VALUES ('"+project+"','"+desc+"')"; int status1=st1.executeUpdate(sql1); the above code is working fine as long as im inserting text data with out quotes. However, its failing when im triyng to insert text data which contains quotes. How can i insert ...

7. Inserting Text File in Database    coderanch.com

hi all i want to insert a text file in database(i am using oracle 8i) in java.i want to know how to insert the file in database pls tell me how if possible pls give any sample code. pls tell me how to read a text file from database also. regards Gopinath

8. Regarding updating Database from Text file.    coderanch.com

Hi Ranchers. I am not sure is this the right forum for this question. I am trying to come up with a logic for a small utility. Bascially I need to run a java program that will call a Stored Procedure to insert records into a table from a text file which has several hundred rows. If the rows are being ...

9. export query from table column to text file    coderanch.com

import java.sql.*; import java.io.*; public class filejebc { /** * @param args */ public static void main(String[] args) { try { Connection cn=null; Class.forName("org.postgresql.Driver"); String url="jdbc:postgresql:postgres"; String user="postgres" ; String password="Welcome123"; cn=DriverManager.getConnection(url, user, password); Statement st = cn.createStatement(); ResultSet res = st.executeQuery("SELECT * FROM emp"); System.out.println("Employee Name: " ); File f=new File("output.txt"); FileOutputStream fp=new FileOutputStream(f); while (res.next()) { String employeeName = ...





10. How to insert data from a text file to the database and be able to show it in the web application    coderanch.com

Hi guys, I am currently doing a web project called alumni and got some problem with reading the data from a text file. I have database access , person and import classes. In my import class I get one mistake. Can you help me to solve it. Thanks in advance. Bellow the code where I need to solve this problem import ...

12. fulltext - math - query    coderanch.com

Dear, I'm trying to build the query below for a more detailed search, but giving this error. Under the original code: [code] queryPrincipal.append ("FROM manufacturer f, filial_produto fp, f branch, and origin"). append ("WHERE"). append ("= f.filial fp.filial AND"). append ("fp = p.cod_material. cod_material AND "). append (" f.descricao like? "); [/ code] I tried to develop this way: [code] queryPrincipal.append ...

13. Insert text records from text file into a DB    java-forums.org

Hi everyone, I actualy need help, i created a class that reads a file which inculds abstructes of scientific researches (assume the file includes 200 abstracts) unfortunately, felled to submit the text into my DB. What I need is that each abstract to be inserted as a individual record in the DB but i could not neither insert the text as ...

14. How to read from text file and insert into database using java    java-forums.org

Hi all, Please somebody help me, i am newbie in Java. i have questions about java programing, how to read from text file and insert into database. I have text file let's say like Header A123445 U156664 A734355 U835353 A535355 Footer I wanna be able to read the text file and skip the header and footer, String A means i have ...

15. Is it possible to insert data into database from a text file which contains    forums.oracle.com

So is the question how to write the SQL script or how to execute them? You can use executeUpdate(String sql); within Java to execute sql commands passed in as strings, or you could simply write the commands in a script (script.sql) and just execute it from the command line. If it is the actual SQL commands you want to know...you are ...