Home Answers Viewqa JDBC JDBC connection and SQL Query

 
 


Kiran
JDBC connection and SQL Query
1 Answer(s)      3 years ago
Posted in : JDBC

Hi,

I'm reading a all files one after the other in a directory in java. storing the values in an array of string each time. Now I'm trying to execute a query to insert those values into an oracle DB. But I'm trying hard to figure out syntax for inserting into a table using variables. I'm trying to execute following command. Though I use executeQuery or udate Query it is not accepting as the format for them is executeQuery(String). My goal is to insert into Names Table values stored in temp[0] and temp[1]. In short I read values in array of temp, and I need to insert into DB using those variables, please give me proper syntax with quotation marks as I'm finding hard to make it. even the code i wrote below has some error with quotation marks. but i donno where to place them.


while((s3=reader.readLine())!=null){
String [] temp = null;
temp = s3.split(",");
statement.updateQuery("insert into Names values"+temp[0],""+temp[1]);

thanks,



View Answers

June 7, 2010 at 12:33 PM


Hi Friend,

Please visit the following link:

http://www.roseindia.net/tutorial/java/io/insertFileData.html

Hope that it will be helpful for you.
Thanks









Related Pages:
JDBC connection and SQL Query - JDBC
JDBC connection and SQL Query  Hi, I'm reading a all files one... each time. Now I'm trying to execute a query to insert those values into an oracle... or udate Query it is not accepting as the format for them is executeQuery(String
jdbc connection
"); Connection con = (Connection) DriverManager.getConnection("jdbc:mysql://127.0.0.1...jdbc connection  How to Submit data????   <%-- view... { Class.forName("com.mysql.jdbc.Driver"); Connection con = (Connection
sql query - SQL
sql query  hi sir,i have a month and year numbers,when i am enter a month and year in sql query then i want results for 1st day of month to last day..."); Connection connection = DriverManager.getConnection("jdbc:mysql://localhost
SQL query - SQL
("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection("jdbc:odbc:access...SQL query  hi sir/Madam i am using MS Access where i have table like Fees_Struc: Amount (INT) Due_Date (Date) Fees_Pay: Paid(INT
sql query - JDBC
sql query  I need a SQL query to add data into database
SQL QUERY - JDBC
SQL QUERY  I m running a query using apache tomcat the sql query is on adding an employee in the database whenever i click on add after inserting the values i am getting a java.lang.nullpointer exception
JDBC Connection code to connect servlet with SQL Server 2008
JDBC Connection code to connect servlet with SQL Server 2008  Please... support for JDBC 4.0. i try Avery thing but i m not success so please ans me . My connection code is static Connection con; static Statement st; static
JDBC- SQL spatio-temporal query
JDBC- SQL spatio-temporal query  Any one give me a JDBC sql query... as shown in above. I want a spatio-temporal query using JDBC-SQL to retrieve... query2 7 trajectory is HHBHC I want a SQL query
JDBC- SQL spatio-temporal query
JDBC- SQL spatio-temporal query  Any one give me a JDBC sql query... as shown in above. I want a spatio-temporal query using JDBC-SQL to retrieve... query2 7 trajectory is HHBHC I want a SQL query
j2me jdbc connection - JDBC
j2me jdbc connection  hello, whn i m importing sql package in mine midlet(tried for both javax.sql.* and java.sql.*;)..itz nt accepting it... hw to get connected to database?????.... plz help me out
creating jdbc sql statements - JDBC
creating jdbc sql statements  I had written the following program...)   Hi friend, i think, connection problem. i am sending jdbc...."); Connection con = null; String url = "jdbc:mysql://192.168.10.211
jdbc & sql related project - JDBC
jdbc & sql related project  code using jdbc,odbc,swing,MySql classes... from a list and execute any sql query related to the selected database e.g... this sql query so that it can be executed and required data can be displayed
Database connection sql server 2005 - JDBC
Database connection sql server 2005  Hi all i am developing an application in struts and i need to connect database for that application using sql server 2005.. can anyone tell me how to make database connection ..plz help me
jdbc query
jdbc query  hello sir I have used your simple bank application... but it show sql exception error data type mismatch in criteria expression. But I have used your complete project with My SQL database it showed the transaction
jdbc query
jdbc query  hello sir I have used your simple bank application... but it show sql exception error data type mismatch in criteria expression. But I have used your complete project with My SQL database it showed the transaction
jdbc query
jdbc query  hello sir I have used your simple bank application... but it show sql exception error data type mismatch in criteria expression. But I have used your complete project with My SQL database it showed the transaction
jdbc query
jdbc query  hello sir I have used your simple bank application... but it show sql exception error data type mismatch in criteria expression. But I have used your complete project with My SQL database it showed the transaction
MS-ACCESS Query Problem - SQL
MS-ACCESS Query Problem  hi sir i have table which is initially... tables Course and Class wise Ex..Query like: if we execute this Query... records so these all records i want to insert into Deleted Table plz can u give Query
Sql Connection is not creating
Sql Connection is not creating  Hi i am developing an web application..for that i am using excel as database. To connect for database am using jdbc... it is creating sql connection and allwoing me to access excel but when i am
REQ for connection b/w jdbc and oracle database
REQ for connection b/w jdbc and oracle database    REQ for connection b/w jdbc and oracle database    The Java classes to connect... (OCI or Thin) through the JDBC connection URL. Here are some connection URL
sql-jdbc
sql-jdbc  how to execute select query using prepared statement
JDBC connection timeout
JDBC connection timeout       The Tutorial describe you a JDBC Connection timeout. In this program, we... The code include a class JDBC Connection Timeout, inside the main method we include
Java-Connection Pool - JDBC
Java-Connection Pool  How can I create a connection pool. My database is MS SQL server 2000(username-sa, pwd-admin) and my application server is Weblogic 8. Which is the best approach to create a connection pool? Kindly help
JDBC
JDBC  write a JDBC program to display the result of any query...").newInstance(); Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root" ); String sql = "Select * from data"; Statement stmt
PHP SQL close connection
PHP SQL close connection       PHP SQL close connection is used to close a connection between the PHP... 'PHP SQL close Connection'. To understand and grasp the example we include
JDBC Execute Query
JDBC Execute Query       The  Execute Query in JDBC retrieve the elements from a database. In this Tutorial we want to describe you a code that helps you to understand JDBC Execute Query
query
;/b></td> </tr> <%try{ Connection conn = null; Class.forName("com.mysql.jdbc.Driver").newInstance(); conn = DriverManager.getConnection("jdbc...); out.println(id[i]); } %> <%try{ Connection conn = null; Class.forName
JDBC Connection and Registration
JDBC Connection and Registration   How to create a JDBC connection..... :-)   JDBC MS Access Database Connectivity: Follow these steps: 1)Go... your java with jdbc code.. It will create table in MS access database. Here
sql - SQL
sql functions with examples  I need sql functions with examples...;<b>User ID:</b></td><% Connection con = null; String url = "jdbc:mysql://localhost:3306/"; String db = "register"
sql - JDBC
sql  hi am keerthi java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'Source=:src...://www.roseindia.net/jdbc/jdbcconnectivity.shtml You will find the solution. Thanks
JDBC Connection Pool
database connection and executing the SQL statements Benefits of JDBC Connection...JDBC Connection Pool In this section we will learn about JDBC Connection Pool... application will give you improved performance if you use the JDBC Connection
Sql - JDBC
SQL Statement and prepared statement  What is Statement and prepared... of PreparedStatement only we have to generate a query inside the program. This query... = conn.createStatement();In case of PreparedStatement only we have to generate a query
sql - JDBC
sql  java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'origin=:src destination=:dest'. what's the solution for that problem
sql - JDBC
sql  java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'origin=:src destination=:dest'. what's the solution for that problem
JDBC connection
JDBC connection       The JDBC.... The JDBC includes execution of SQL queries return a result set over... we illustrates you JDBC url connection. The current Tutorial helps you
JDBC - JDBC
()); Connection conn = DriverManager.getConnection("jdbc:oracle:thin: @localhost...JDBC  how can i do jdbc through oracle.. pls if u can send me d.... thanking u santosh.  Hi Friend, Use JDBC with Oracle Follow
JDBC - JDBC
JDBC connection to database and show results  Check if the database... Exception{ Connection conn=null; try{ Class.forName("oracle.jdbc.driver.OracleDriver"); conn = DriverManager.getConnection("jdbc:oracle:thin
jdbc - JDBC
,you have to use: Connection conn = DriverManager.getConnection("jdbc:oracle... driver,you have to use: Connection conn = DriverManager.getConnection ("jdbc...jdbc   kindly give the example program for connecting oracle dase
mysql query
with ("jdbc:odbc:excel"). Execute query "select name, address from [Sheet1$]". Here...("com.mysql.jdbc.Driver"); Connection conn = DriverManager.getConnection("jdbc:mysql...mysql query  how do transfer into the excel data to my sql  
Query regarding JSP, JDBC
Query regarding JSP, JDBC  I have a table in SQL Server database storing some ids and names. In my jsp code a while loop is displaying the list... by running a query through the id corresponding the name using arraylist
query related to jdbc
query related to jdbc  hello, i have done my database connection successfully ie db2 with RAD. but while running my application i am not able to fetch the data so please suggest and help me
connection
connection   how to make multiple database connection using jdbc
Could not establish the connection to oracle - JDBC
to use: Connection conn = DriverManager.getConnection("jdbc:oracle:oci8... to use: Connection conn = DriverManager.getConnection ("jdbc:oracle:thin... oracle.jdbc.driver.OracleDriver()); Connection conn = DriverManager.getConnection("jdbc:oracle
Execute database query by using sql tag of JSTL SQL library
Execute database query by using sql tag of JSTL SQL library... to create application that execute sql query given by user using JSTL SQL Library. To execute query first create a data source and then execute sql query
how do i use sql like query in my jsp page
how do i use sql like query in my jsp page  how do i use sql like query in my jsp page   Hi Friend, Try the following code: <%@ page..."); Connection con = DriverManager.getConnection("jdbc:odbc:student
Error while SQL Server connection to Java
Error while SQL Server connection to Java  import java.sql.*; public..."); con=DriverManager.getConnection("jdbc:odbc:SQL_SERVER;user=DTHOTA;password...("password", " "); con=DriverManager.getConnection("jdbc:odbc:SQL_SERVER", prop
Error while SQL Server connection to Java
Error while SQL Server connection to Java  import java.sql.*; public..."); con=DriverManager.getConnection("jdbc:odbc:SQL_SERVER;user=DTHOTA;password...("password", " "); con=DriverManager.getConnection("jdbc:odbc:SQL_SERVER", prop
JDBC autocommit
JDBC autocommit       JDBC connection.... A connection object is used to send and execute SQL Statement to a backend database...; for select query in sql and the value obtained from it stored in  result set rs.The
connection - SQL
connection  how can i establish connection between netbean_ide6.9 with mysql or oracle  Hi Friend, Please visit the following link: http://www.roseindia.net/jsf/visual-jsf.shtml Hope that it will be helpful
insertion in SQL - SQL
insertion in SQL  Query is "insert into employee values('"+eno... in the database because of single code in the name. dbase is MS-SQL emp.name data type... as I know string parameter in SQL is denoted as 'john' . I think thats why

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.