field « Operation « Java Database Q&A





1. access to auto increment identity field after SQL insert in java    stackoverflow.com

Any advise on how to read auto incrementing identity field assigned to newly created record from call through java.sql.Statement.executeUpdate ? I know how to do this in SQL for several DB platforms, ...

2. how to insert 18,6 decimal number value into database field using java    stackoverflow.com

how to insert 18,6 decimal number value into database field using java. ?

4. Updating only modified fields    coderanch.com

Hello all, Consider a scenario in which a form with several editable elements are shown to the User. This form has a save button. Now the User makes some changes and clicks on the save button. The usual practise is to save all the elements (rather than the changed ones). I have heard that its a better practice to save only ...

5. Updating only modified fields    coderanch.com

Hello all, Consider a scenario in which a form with several editable elements are shown to the User. This form has a save button. Now the User makes some changes and clicks on the save button. The usual practise is to save all the elements (rather than the changed ones). I have heard that its a better practice to save only ...

8. how to update only the modified field values    coderanch.com

As you are asking this in a Java forum, I assume you have a Java program that reads from a database, allows the user to change the values and then saves the data back to the database. Without more details of your program it is difficult to give you more than general advice such as you will need to have flags ...

9. how to construct a sql query when field having single quote    coderanch.com

Hi all, I have been working on web application , here is my requirement: I'm constructing sql statement dynamically from dynamic user input (form data). In one of the field having single quote. while executing the query it is getting problem because of single quote .. so how do i resolve my problem. single quote should be there. (I'm using Ms-Access ...





12. Question on query - select one row with max value in one field    coderanch.com

Steven, Why do you have id in the main query? Doesn't that make it distinct? Also, note that you could get more than one record back if there are identical prices. I would use the code you wrote because it isn't database specific. Another approach is the following. Note that your database needs to support returning only one row and you ...

13. how to insert null in numeric field    coderanch.com

I am having a problem pertaining to this subject. What if the table entry is an integer but a foreign key to another table? setNull sets an integer to 0 and not null so the update fails as 0 is not a valid reference to another table. Is their a way to pass it the null sql type ...... set column=null ...

14. inserting repeated values in primary key field    coderanch.com

Hello i want to send an array values to be inserted in table field that should be a primary key for the table so when i try to insert a repeated value in that colume , sql excepption will be thrown i want to insert all values that not repeated and escape any reapeated values without throwing an exception that make ...

15. Problem in updating the fields to database    coderanch.com

Hi I am trying to display records then onclick edit button the fileds will edit then update button , onclick this button the database shd update with the fields, I am getting NullPointer Exception, Dont knw wats the problem, Here is my code OutransEdit.java package update; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.sql.*; public class OutransEdit extends HttpServlet { public ...

16. Help!!! Insert a new record with a field whose value based on existing records    coderanch.com

Hi pals, I have a CONTRACT table with 2 interested columns: NO (order number) and SIGNED_DATE, none of which is primary nor foreign key. The problem is that NO column must be auto-incremented on the same signed date. In other words, contracts with the same signed date should have order number increase in order from 1, depending on which one is ...





17. Update field in table    java-forums.org

com.microsoft.sqlserver.jdbc.SQLServerDataSource ds = new com.microsoft.sqlserver.jdbc.SQLServerDataSource() ; ds.setServerName("ServerName"); ds.setDatabaseName("DBName"); ds.setInstanceName("InstanceName"); ds.setUser("user"); ds.setPassword("password"); Connection con = ds.getConnection(); Statement stmt = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE); while(selectedRS.next()){} String tempString7 = "UPDATE TOP " + airCardsRequested + " dbo.Assets SET StatusID=\'Reserved\' WHERE Description Like \'%Air Card%\' AND StatusID=\'extra\'"; int tempInt = stmt.executeUpdate(tempString7); Getting the error: Incorrect Syntax near '1'. Any idea what might be causing it?

18. Inserting to a database through a field    forums.oracle.com