1. Java Statement Object Reuse? stackoverflow.comI would like to know if we can reuse the same Statement object for executing more than one query. Or, should we create a new statement for different queries. For example,
|
2. When using the latest jdbc driver for SQL Server 2005/2008 how do prepared statements, views, and stored procedures compare regarding performance? stackoverflow.comWhen using the latest Microsoft jdbc driver for SQL Server 2005/2008 how do prepared statements, views, and stored procedures compare regarding performance? If I have a plain old select statement with ... |
3. statements in jdbc stackoverflow.comdoes statement object contain the session id the database returns for the current session? What does a resultset contain? |
4. Deconstruct an SQL Statement in Java stackoverflow.comI have some legacy SQL and I want to split it up into it's constituent parts & then add more criteria, an order by clause, etc. Are there any existing Java libraries ... |
5. Does SqlCommand optimize parameterized sql statements? stackoverflow.comI know in Java, when using PreparedStatement with parameters, some JDBC drivers will optimize the SQL queries by turning them into stored procedures so that all the subsequent calls will run ... |
6. Java - Storing SQL statements in an external file stackoverflow.comI am looking for a Java library/framework/technique of storing SQL statements in an external file. The support team (including DBAs) should be able to alter (slightly) the statement to keep them ... |
7. Java Programming - Where should SQL statements be stored? stackoverflow.comWhere should an JDBC-compliant application store its SQL statements and why? So far, I managed to identify these options:
|
8. Java: Writing SQL Statements stackoverflow.comI'm writing a one-time Java program to add a bunch of rows in a CSV file to a MySQL database. Are there any Java classes/toolkits to help with this? Something that ... |
9. Java is there any IDE/Tool that can pull SQL statements out in to a file? stackoverflow.comHi is there any tool available in Java world that will parse/read a source file and pull SQL statements out in to a text file. This is a complex task given ... |
10. Parsing and modification of SQL statements in Java stackoverflow.comDoes anyone know about a SQL statements parser, in Java, that would allow having an Object representation of a SQL query, allow modifying this representation and generate back the updated SQL ... |
11. How to differentiate SQL statements that modify data from those that are read only? stackoverflow.comI need to write a jdbc compliant driver wrapper whose purpose is to log all SQL statements that modify data. What is the easiest way to differentiate those statements that modify ... |
12. SQL statement ‘IN’ contains too many expressions stackoverflow.comI use JDBC to retrieve Oracle database by ‘IN’ statement. But there are too many expressions, about >1000. It looks like:
|
13. Can I use SQL's IN(...) statement for a namedQuery? stackoverflow.comHow can I use IN at my namedQuery?
|
14. Modify sql statements generated by JDBC stackoverflow.comWhat is the simplest way to intercept and modify sql statements generated by jdbc driver? There is something like P6Spy. According to information from google, an open source framework to support ... |
15. JDBC SQL : if statement string == char.toString not working. :) stackoverflow.comHow come my if statement |
16. SQL parser library for Java - Retrieve the list of table names present in a SQL statement stackoverflow.comI am looking for a SQL Library that will parse an SQL statement and return some sort of Object representation of the SQL statement. My main objective is actually to be ... |
17. Statement object using: stackoverflow.comI have Java code that connects to an SQL server DB but I cannot access the DB from the Java app. When I compiled the connection was successfully reported but I ... |
18. Statement in Database in java stackoverflow.comhi i wrote a servlet and its showing no output my code is
|
19. Need java API to parse SQL statements stackoverflow.comI am in need of a java API to parse a SQL statement. for example, I have a SQL query
I ... |
20. Dynamically create print statement in Java stackoverflow.comI query a database and get a lot information back that should be presented to the user. In the database I have fields a, b, c, d and e. Now, the ... |
21. JDBC: Alternative of statement.cancel() in Informix DB? stackoverflow.comI want to cancel a JDBC call if it's taking too long to respond from Database server. I have read here Statement.cancel() is not supported by Informix driver. So ... |
22. Slow repetitive execution of DDL and DML statements using JDBC stackoverflow.comFor integration tests running against 11 different RBDMS for a database abstraction library, I need to frequently reset the schema and/or data. This means, I run plenty of statements for most ... |
23. Java library to write sql statements? stackoverflow.comDoes exists a java library that can create sql statements? I'm not in search of something fancy, just something at "string manipulation" level: I just use jdbc (with Preparestatements and Resultsets) but ... |
24. SQL statement in Netbeans controller stackoverflow.comI want to use an update SQL statement in my Netbeans controller class. Method in controller:
|
25. Creating a Teradata stored (SPL) using JDBC - statement is not recognised as a whole stackoverflow.comI'm trying to create a stored procedure (using SPL) in
I'm getting ... |
26. Execution of SQL statement in Java function stackoverflow.comI have to read the below SQL statement from one properties.
And value for score version I've to take it from other properties file.
But, ... |
27. Why does java.sql.Statement break backward compatibility? stackoverflow.comThere are three more methods declared in |
28. Running SQL statement in java forums.netbeans.orgI am using netbeans to connect to my server i can pull all the data with the java.util.Iterator |
29. Several SQL statement jmeter.512774.n5.nabble.comHi Can somebody help me how I can execute several JDBC statement. I want to be able to create several table with one JDBC request. Cheers Richard ______________________________________________________________________________________________ Smals sluit elke aansprakelijkheid uit in verband met de juistheid, de volledigheid of het tijdig toekomen van de informatie in deze e-mail. Aan deze e-mail kunnen geen rechten worden ontleend en deze e-mail ... |
30. Regd: Pass sql statements through XML coderanch.com |
31. Avoiding hardcoded SQL statements coderanch.comOkay, I'm working on the first iteration of an application and one thing I want to avoid doing is hardcoding lots of SQL statements in my code. In later iterations I'm going to create a full-blown database persistence layer, but in the short term I'm wondering if anyone knows a clean way to dynamically generate SQL. Any thoughts/ideas/suggestions? |
32. SQL Statement Not Working Properly coderanch.com |
33. JDBC DB/2 statement delimiter problem coderanch.comAny help on this matter would be greatly appreciated. I am trying to write a shopping cart application. I have a DB/2 SQL statement that will check to see if a certain item is in the Shopping Cart table, if it is it increments the quantity by one, if it is not it adds the item and sets the quantity to ... |
34. Statement functions coderanch.com |
35. Using single quotes in a SQL statement coderanch.com |
36. SQL Maximum Statement coderanch.comI have a table that is ordered by artID with 1 being the first and so on. I want to select the entire last row, but so far have only been able to select the max artID instead of the whole row. This is what I've been using: SELECT MAX(artID) AS artID FROM articles I need something that selects the whole ... |
38. Prepare Statement? coderanch.comCan any one tell me how to send a prepared statement to the log file whith set values..? For example Statement stmt=Connection.prepareStatement(update emp set empno=? where empid=?) stmt.setInt(100); stmt.setInt(1000); I want to see my log file contains some statement like update emp set empno=100 where empid=1000. I want to know how to S.O.P this to log file? Thanks, A.Umar |
39. what is the return value of executeUpdate statement to create a table? coderanch.com |
40. Simple SQL statement coderanch.comYou were right when you tried to add quotes to the query, cause this is the fault. The only thing you have to be look for is that some databases only can handle single quotes. Also you have to be careful with the syntax when you use double quotes. double quotes(you have to masquerade them): String sql = "SELECT * FROM ... |
41. class library representing SQL statement? coderanch.comHi, I'm looking for a library that manipulates SQL statements, something along the lines of: SQLQuery q=new SQLQuery("SELECT name FROM employees"); if( selectedDepartment != null) q.addWhereCondition("dept",selectedDept); if( user.isAllowedToLook() ) q.addColumn( "salary" ); resultset=q.execute(); It's for an application where the same data is being looked at by users with various combinations of permissions and preferences, so there's a core query that stays ... |
42. help with a statement coderanch.com |
43. Regd JDBS Statement... coderanch.com |
44. help with a sql statement coderanch.comhello everyone i hope someone can help me. i have this code which is below. what the code is doing is testing to see if any other strings are equal to st1 and if they are get there values from the hashtable.(which is ok) But now i want set a sql statement so that the keys of all the values that ... |
45. how to get the source of created statement coderanch.comI don't know any method in the API that would give you that, but I've done this with PreparedStatemens by inspecting the object after a breakpoint in a debugger. A field with the SQL statement may be implementation-dependent, but you may want to try it. In my case I was using DB2 and it was there. Paulo. |
46. reusing the Statement object coderanch.comhi all, here is what i have, 1. i have a class called DBConnection. where i have put Connection, Statement and ResultSet objects as members. 2. i have a method executeQuery() in that class which takes the query as parameter now, the problem is i have the executeQuery() as follows, public ResultSet executeQuery(String query,boolean IS_UPDATE) throws SQLException { System.out.println("Executing query:"+query); if( ... |
47. Help with an SQL Statement coderanch.comHello. I was wondering if someone could help me with a SQL statement. I have two tables that I need to get data from. Here is some sample data of what the tables look like: Table A Table B PBUF0034 BE PBUF0034 GC PBUF0034 GW PBUF0034 GW ABBS0003 BE ABBS0003 GC ABBS0003 GW I want to be able to run a ... |
48. SQL CONDITIONAL STATEMENTS coderanch.com |
49. the real concept behind statement object coderanch.comI would like to know everything I can do with a Statement object. I mean: How many times can I call execute method? Can I call executeUpdate on a Statement object and then call executeQuery??? do I need to create a statement object to every query I need to execute??? thanks in advance!!! |
50. Statement object coderanch.comHi people!! I'm here to state that I solved the problem and how I solved it... In my application we have two pools, one of them, is a really poor pool, so I decided to add more functionality to this pool, but since the differences would break compatibility I created another class, and since time isn't enouth I decided to take ... |
51. reuse java.sql.Statement coderanch.com |
52. Which SQL Statement should use for that?? coderanch.com |
53. check out this SQL statement coderanch.comI'm trying to make an advanced search page in JSP where the user can search based on multiple criteria... But I want the user to be able to leave some of the criteria blank (i.e. under gender, if they went male and female results, then they just don't change the select box) So I've done something like this, leaving the option ... |
54. Create statement coderanch.comI am trying to create a table with several columns. I would like to not put all of the column names on one line because you would have to scroll over to see the full line. Can I do something like: "CREATE TABLE Reimbursement (GroupAcctNumber VARCHAR(10), SSN VARCHAR(9), name VARCHAR(20), date VARCHAR(10), providerSSN(9), providerName(20) amount float(7), description VARCHAR(45))" |
55. Statement object a Inteface or class? coderanch.comOne of the strengths of JDBC is that it is all based on interfaces. Interfaces allow you to define the behaviour of a class without defining the specifics of how thet behaviour is implemented. One of the only concrete classes you usually deal with in JDBC is the DriverManager, and everything after this in terms of interfaces. Note that a Connection ... |
56. Build SQL Statements coderanch.comI'm not aware of anything like that. It might be a fun exercise to build. You could step through the column metadata and build up an insert statement as a string. You could return a prepared statement ready for a client to plug in values for the ? in the SQL. Aside from the fun, I'm not sure it would be ... |
57. What exactly we mean by Precompiled SQL Statement coderanch.comIf a statement is used multiple times in a session, precompiling it provides better performance than sending it to the database and compiling it for each use. The more complex the statement, the greater the performance benefit. If a statement is likely to be used only a few times, precompiling it may be inefficient because of the overhead involved in precompiling, ... |
58. sql statement executes in Toad, not in app coderanch.com |
59. change statement coderanch.comProperty Description : (list bar) Property Description : null (submit button) ............................................................................. As you can see from the above, i need to choose option from a list bar. after choose an option, it will automatically show at below replacing the null. when the statement is display, i can change it to replace with the more updated one. Then click submit button ... |
60. Need help with a SQL statement coderanch.comThis might be a little off-topic, but I need to write a SQL statement and I just can't seem to work out the syntax. I thought maybe someone here would be able to help me. Let me try to explain the situation. (By the way, this work is being done inside SQL Server.) I have two tables, I'll call them src ... |
61. one statement for two databses? coderanch.com |
62. Statement Object coderanch.com |
63. Statement.setMaxRows coderanch.comHi, I have a few doubts. I have some sql queries which fetch a lot of data from a oracle DB. I wish to use the statement object's setMaxRows() method to restrict the number of records fetched. I wish to know the following. If the query fetches more than say 200 records set through the setMaxRows method,will the truncation of the ... |
64. is this statement correct? coderanch.com |
65. sql statement problem coderanch.comhi all... when we have to pass a string value to a sql stmt .. we usually write (select * from atable where username = '"+username+"').. but supposing we have an int variable int userid = 4; int serialno=2; how will i use this in the sql statement... if i use the below stmt it gives me an error...??? (select * ... |
66. Taking an argument from a file into SQL prep statement coderanch.comI have values from a file that I want to update my database with. Now I'm not to sure how I do this, I want to take these values in the iteration of the file in this case the value MSM. The I want to do an update in the database like so, there will be some 600 rows at a ... |
67. OracleCallable Statement coderanch.com |
68. Problem with preapred Statement coderanch.comI am writing a batch program and I have Prepared Statement class where I would like to prepare all the queries before I start processing the files. But the problem is When I try to execute the Prepared statement, it becomes null . For example it is null in getData(String value) method of below code snippet. public class PrepareQuery { private ... |
69. Statement Cache--Memory required? coderanch.comHi all, Can some one help me with an answer for the memory taken for each statement cached in Websphere 5.1.1.3 if pooling and DataSource is used? I am supposed to set a value and the default is 10 connections. I want to know how much memory is taken for each of the statements (preapared) cached. I am sure this is ... |
70. SQL statement to java coderanch.comYour procedure is anonomously defined - you need to create the procedure properly (as I think you are aware via "create or replace procedure foo ( ... )") and call it from Java via a CallableStatement. That being said, your procedure seems to only manipulate a date format. You don't need to use any DB code to do this - particularaly ... |
71. using prepare statements coderanch.comThe soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - ... |
72. Putting SQL statements in MVC application coderanch.com |
73. Stumped on a SQL Statement coderanch.comHi all, I'm trying to write a SQL statement (or series of statements) in a stored procedure and I'm having trouble working out the logic. I have 3 tables that look something like this: Customers +--------------------+ | Name | Customer_ID | +--------------------+ Service Types +---------+ | Type_ID | +---------+ Services Rendered +----------------------------------------+ | Customer_ID | Type_ID | Date Performed | +----------------------------------------+ ... |
74. prepared or general statement in JDBC coderanch.comThe use of a Statement in JDBC should be 100% localized to being used for DDL (ALTER, CREATE, GRANT, etc) as these are the only statement types that cannot accept BIND VARIABLES. PreparedStatements or CallableStatements should be used for EVERY OTHER type of statement (DML, Queries). As these are the statement types that accept bind variables. This is a fact, a ... |
75. case sensitive sql statement for username and password coderanch.comEric is correct in that case sensitivity definitely depends on the database. Many, like Oracle, are case sensitive by default. Which database are you using? I don't know of any db setting that leaks through to the OS. However in this case, it is the SQL/db that is requiring the case sensitivity anyway. |
76. PreparedStament and Statement coderanch.com |
77. what is the meaning of "1=1" in sql statement coderanch.comhi dear, '1=1' are conditions used in where clause. it is taken as always true condition. Similarly statement like '1=2'or 1=3 etc means condition is false. this statement are used generally where we want to copy structure of the wxisting table but not the content of the table. suppose we hava table emp(name,age). and it has data also. we can fire ... |
78. How to construct the SQL statement ? coderanch.comDear all, I am a fresh JSP leaner, i would like to know how to construct the SQL statement in JSP. I have no problem with the database connection, but a statement problem. Let's say, i have a table (created in MS-Access) ABC, with 2 fields, ID (Number data type), Name (Text data type). How can i construct a statment to ... |
79. Unable to cast preparestatement of weblogic6.1 to oracleprpepared statement coderanch.comGroup, Am facing typical problem in casting prepared statement to oracleprepared statement. Inorder to provide multilingual support in one of our project, we followed the database type conversion for unicode support (changing varchar2 to nvarchar2). I guess setFormOfUse() in oracle prepared statement have to be used for any inserts in column of type NVARCHAR2. My application is running in weblogic6.1 and ... |
80. SQL statements coderanch.com |
81. Limit on number of statements exceeded coderanch.comOriginally posted by B. Daniel Eriksson: Hi, I have a problem with the number of open PreparedStatements on a JDBC connection (JTOpen). java.sql.SQLException: Limit on number of statements exceeded. The problem comes from a large number of statements being executed on the same connection before it is returned to the pool. I am pretty sure that i close all statements and ... |
82. how to count total number of records in each group , when using group by statement. coderanch.comHi Thank you for reading my post. is there any way to count total records in each group of records when using "group by" command ? for example i need to find how much people log in each hour of a day. in this case i can use group by to group the record based on hour field and then use ... |
83. properties file with SQL statements coderanch.comHi there, I'm running an application that is connected to a MySQL database. I have a Servlet with a method that connects to the database and attempts to update a table named INSTRUCTORS. I keep a properties file full of SQL statements, one of which is: updateInstructorQuery=UPDATE INSTRUCTORS SET ADMINISTRATOR_ID=?, RETIRED_ADMIN_ID=NULL, EMPLOYEE_ID=?, FIRSTNAME=?, LASTNAME=?, DEPARTMENT=?, WORK_PHONE=?, ADDRESS=?, CITY=?, STATE_PROVINCE=?, COUNTRY=?, ZIP_PCODE=?, ... |
84. If Statement&Equals coderanch.comSome questions that may guide you towards an answer: - What does "sonuc.first();" accomplish? Can you leave it out? - What does "if block didn't work" mean? Are any of the if conditions true or false when they shouldn't? - What is the value of "deger[0]" when it is first used? Has it been initialized? - Why are deger and kont ... |
85. questions about statement types and performace . coderanch.com |
86. Reusing Statement Object coderanch.comHave you tried it? The answer is generally 'no'. Some JDBC driver implementations may support such a syntax, but it is far from standard. In the 'lucky' case that the first statement return 0 or 1 results (in which case it should be an 'if' statement not a 'while' loop), then it would not produce an error. Where it is likely ... |
87. statement coderanch.com |
88. trivial err in sql statement coderanch.comHey guys, I would like to add another 'filter' to the statement below: //this works SELECT PD.ID, SUM(PD.amount) AS payment_total FROM paymentDon AS PD GROUP BY ID when adding this: WHERE PD.payment_total>90 in SELECT PD.ID, SUM(PD.amount) AS payment_total FROM paymentDon AS PD WHERE PD.payment_total>90 GROUP BY ID I get an error message - anyone? |
89. Statement,PrepareStatement coderanch.com |
90. SQL statements coderanch.comHello I've got a little trouble with SQL! I dont know if the cause is MS Access My SQL statement is supposed to return the data in 3 columns, these columns are in different tables... Sometimes a table can be empty... and due to this, rather than the SQL returning the values in the other 2 table (which contain some data), ... |
91. Statement and it's Fetch Size coderanch.comHi Everyone, I have query regarding how jdbc fetches the rows from the database. For exmaple i have a table say item in the database that contains the 1000 records and i want to retrieve these records through JDBC so code is /*************** Dummy Code *****************************/ Connection conn = DriverManager.getConnection(url,login,pass); Statement stmt = conn.getStatement(); stmt.setFetchSize(100); ResultSet rtst = stmt.executeQuery("Select * from ... |
92. Better sql statement? coderanch.comI know the subject doesn't help much, bear with it please. Here is hte scenario. I have a table mytable with five userID fields user1,user2,user3 etc. I have the actual users table with fname and lname (firstname,lastname) what is the best query to bring the user names for a given record in MYTABLE ? Should I do a left join five ... |
93. Performance Issues with next statement coderanch.comIn my code I use a while loop and next method on my result set. However, in this case it is taking upwards of 2 seconds to execute the next statement. Any ideas? The result set is only 4 rows. Am I not understanding exactly what the next method on the resultSet object is doing. It seems as if from the ... |
94. Unable to get Statement Object. coderanch.comHi All, One of the existing application which is used over a period of time causing a problem all of sudden. When investigated i found the Statment object is not returned from the Connection object. System.out.println("Connection is closed " +conn.isClosed() ); //isClosed() is returing false, which making me to belive connection is fine. Statement st =conn.createStatement(); //st is null What whould ... |
95. whts wrong in this statement? coderanch.comWell, for one, you don't need parens around the set fields, also a couple of your field names have "No" in the name, which I assume means number. You are adding these fields as if they are strings, so check that those fields are actually character and not number types in the database, and last, but definately not least, there is ... |
96. Statement and PreparedStatemnet---ORA-01000 coderanch.comHi All, I am facing one problem in my application only some times. The problem description shows it is regarding cursors opened (ORA-01000). Please see the code below... closeDBStuff(Connection con, Statement pStmt, ResultSet rs){ if (rs != null) rs.close(); if (pStmt != null) pStmt.close(); if (con != null) con.close(); con=null; rs=null; pStmt=null; } I am calling this method from all my ... |
97. Callabe Statement Return Values coderanch.com |
98. Types in statement coderanch.com |
99. Can statement be used in multi-thread? coderanch.com |
100. Can statement be used in multi-thread? coderanch.comHi ranchers, I am new to JDBC, I wonder if the statement can be used in multi-thread. I mean i create a statement object by Connection. And pass the reference to mutli-thread, then mutli-thread uses the statement to executeQuery, can it work? And can preparedStatement work that way? i write some code to test import java.sql.*; public class Test { public ... |