Data 2 « Database « Java Database Q&A





1. Getting data from database into a collection    coderanch.com

I've been trying to change some code from Hibernate into JDBC (as my cide queries a separate db in a project) and have come more than a little unstuck and would be graateful for some advice (and any explanations on why I've gone wrong so I can learn rather than guess). The original Hibernate code is: public Collection getGroups(BwPrincipal val) throws ...

2. Sort very large data without using database    coderanch.com

Hi, Welcome to JavaRanch! The classic, most general solution is an N-way merge sort. Divide the data into chunks that fit in memory, and sort each one in-core, then write out individual sorted data files. Now open all the files, and read one number from each. Write the largest one to the final file, and replace it with a number from ...

4. Storing form data in a database    coderanch.com

Hey, I've a HTML form say,Feedback.html.I need to retrieve values from it and store it in the database table.I ve got FeedbackServlet.java which shd be doing this.I am storing the values in the vector. But the problem is,The order of columns changes for every Submit.So i can not store as is it in a table.What do i do??and How?? Shd I ...

5. problem with posting form data into database    coderanch.com

I am trying to insert data from a form into a database. But i keep getting this error : Cannot find any information on property 'plantitle' in a bean of type 'InsertManager' what does it mean.The property is included in JSP and the bean.Heres the code: <%@ page errorPage="Exception.jsp" %> ...

6. How to get data from a database    coderanch.com

I'm having a bad hair day or something, if some one can give me some clue, I have servlet that is initiated at start up I query the database and get a record set let say 500 rows 30 columns ID, Name, Number etc... 1. how do I get the column name let say getColumnName("ID"), getColumnName("Name"), etc.. I iterating through the ...

7. best way to collect data and put it in db    coderanch.com

Hello everybody, I am working in a "questionair" which is a many steps wizard I need to collect all the data then make a confirmation page then put them in a mySql db with my normal way ( getParameter() for each one) it will be difficult . also which session way i can use Thanks very much

8. get fresh data from database using HttpSessionListener    coderanch.com

[1]I have a class called 'Customer' which implements javax.servlet.http.HttpSessionBindingListener. [2]I have a simple jsp where an end user has to enter his name and then he has to submit to a servlet. [3]Inside this servlet I have a code as follows doGet( blah blah.....) { String userName = request.getParameter("UserName"); Customer cust = new Customer(username); //statement --->1 session.setAttribute("CustomerDetails", cust); /* When the ...

9. storing data without using a database.    coderanch.com

Sir/mam I have to take data from a form and then store that data without using a database. now, again when user inserts next record...same servlet is called which stored earlier record....so the problem is how can i persist previous record and store next record in servlet because every time the servlet is called whole record previously stores is refreshed. I ...





10. How do I retreive my data from a database    coderanch.com

Chase, We need a little more details before your question can be answered. Which database are you using? Are you connecting to it through another program, like a database GUI or front-end? If so, which one? Or, are you trying to access the database programatically? You may want to try the users forum of the database you are using, if there ...

11. data structures and databases    coderanch.com

i have a database and i need to store all the data into a data structure. but which one? my database contains authors, coauthors, and book titles. my data structure should make it possible for me retrieve all authors and coauthors who have worked on the same books together. can anyone help me out? recommend a data structure for me to ...

12. JDBC - Retriving data from Database    coderanch.com

14. Grid computing: collecting data from several databases?    coderanch.com

Hi, I'm very new to grid computing, and would appreciate help on the following: Say I have 2 subsidiary companies, belonging to the same corporation, and I want to manage their personnel database. Now, most of the time, this can be 2 separate instances of the application, unrelated and un-clustered: each company will manage its own people, on its own application ...

15. How to create a drop down on pageload with data from a db    coderanch.com

Hello, I am running a web application on tomcat 6.0 using jsp and mvc controllers.I have a jsp page which has a drop down list. This is the first/home page of the application. The drop down should be populated with data from a database when the page is first loaded. I was hoping to get the data as an object in ...

16. DB Visualizer: quality of the data model    coderanch.com

Hi Roger, What's Minq Software's position with respect to supporting users with the inspection of their models for quality criteria. For example, in our projects we use naming standards for tables and columns, but these standards are sometimes 'forgotten'... Another example, some columns or tables that used to have a purpose, but not anymore, need to be removed... It would be ...





17. Difference between database and data warehouse    coderanch.com

A Database is primarily used for record. Like application databases which work as Online Transaction Processing System where in every transaction has to be recorded, and it is highly optimized for write operations to make sure that every transaction gets recorded. The tables and joins in tables are complex as they are normalized to save storage space. A database uses Entity ...

18. Viewing data from database into an xls format not working    coderanch.com

Hi, I am wondering if anybody could take a look at this code and tell me if they see why my application/vnd.ms-excel is not opening. I am getting no blatant errors in the code, the only thing that is concerning me is in certain bits of the code I get "Note: This element has no attached source and the Javadoc could ...

19. Java to Display Data from Database    coderanch.com

Hello All, I would like to ask one question on Java. I am extremely new in Java and I need help. I want to display data from my database which is Oracle. My code looks like this: import java.sql.*; import java.sql.Driver; import java.sql.DriverManager; import java.sql.Connection; public class tryout{ public static void main(String[] args){ Connection connection = null; try { // Load ...

20. storing checkbox data inside database    coderanch.com

That depends on how you want to store it in the database. You can store it as a comma separated value (Baseball, Cricket, Hockey) etc. or the primary keys of these interests (100, 101, 102) etc. Can you shed some light on how are you planning to store it in the back end.

21. Database data retrieval in many steps?    coderanch.com

I want to retrieve result set from database, If the result set is huge then I want to retrieve some part of total result set and retrieve the remaining in next sequence of retrievals. My question here is In my first database hit ,I retrieve the first set of the result, In the second database hit, How it can refer the ...

22. Display data from a database    coderanch.com

25. Generating PDF with data from DB    coderanch.com

26. data is not comming in order as it stored in database    coderanch.com

i am having a student table in oracle database... but when i am retrieving the data from this table by using resultset and jdbc connection. the rows retrieved by resultset are not comming in order, means according to logic first, first row should come, after that second and so on... but here this order is not predictable, sometime while displaying the ...

27. Fetching and Manipulating Huge data from the database    coderanch.com

Hi all, I have a scenario in which I have to fetch 60-80K records from one schema, process them and then insert those into 5 different tables in another schema. My question is how can I do these as "batches" or "sets of 1000s". Two alternatives I was thinking about: 1. Read all the 80K objects and store them in a ...

28. Get data from my DB    coderanch.com

It would be too easy for us to actually give you the right code in the first place, but thats not the approach of this forum. We try to point you to the right direction so that you can figure it out yourself...more so when you are a beginner in Java. I would suggest you to experiment with the tips given ...

29. Show JavaBeans + data from DB at the same time = Servelt?    coderanch.com

public class CarList extends HttpServlet { private static final long serialVersionUID = 1L; private Statement statement; private Connection con; private String URL = "jdbc:mysql://localhost:3306/cars"; /** * @see HttpServlet#HttpServlet() */ public CarList() { super(); //listAll(); // TODO Auto-generated constructor stub } public void init() throws ServletException { super.init(); try { Class.forName("com.mysql.jdbc.Driver"); con = DriverManager.getConnection(URL, "mike","mike"); } catch (Exception ex) { ex.printStackTrace(); System.exit(1); ...

30. transfer data from one DB to another DB ?    coderanch.com

While it wouldn't be hard to write JDBC code that does a SELECT in one DB, and then an INSERT into the other DB, that's not the best approach. Just about all DBs have their own facilities for bulk-exporting and bulk-importing data; that area is called ETL (extract, transform, load) - check the documentation of the involved DBs for what they ...

31. calculation on data retrieved from database    coderanch.com

problem in retrieving data from database i want to do calculation on data retrieved from database first two rows it prints perfectly but after that it terminates where calculation starts ...................try{ response.setContentType("text/html;"); /*Create PreparedStaement to rerieve employee data*/ // pstmt2=con.prepareStatement ("select * from testImage"); /*Execute the PreparedStatement object*/ pstmt2=con.prepareStatement("select * from testImage"); rs=pstmt2.executeQuery(); out.println("

The info stored in the database as:


"); /* ...

32. Code in database corrupts data.    coderanch.com

I am writing a Java application used as an assistance to for learning new languages. However, I am having some problems with inserting code. I am currently inserting small chunks of Perl code into the database, and this insertion is causing data to become corrupt. It doesn't happen all of the time, and is very difficult to detect where the problem ...

33. Storing DB access data in the DD    coderanch.com

34. Local Cacheing of data from database and using it    coderanch.com

Hello, I am new to java and writing my first spring, ibatis, blazeDS, flex 4 application. In a Remote Object service method I am firing a query returning a large dataset and collecting it into a arraylist. Then I am iterating through that list and refering other data from database over and over again. This is giving me a performance hit ...

35. Best practice to access large data from database    coderanch.com

Dear Friends, I have requirement to fetch 5 Million records from Oracle db and display using JAVA and JSP. Each record is 1 KB size. The database table is online table used to store the transaction details, the rows will keep increasing. I am not allowed to use stored procedures also. 1) Fetching 5 Million record and displaying in 1 attempt ...

36. How to export and import from data from syabse database using jdbc    coderanch.com

Hi All, I have a requirement like ,I need to export /import the data from database for that i will get one xml file and one propertie file 1. Table names properties file 2 . Table relation xml For export i need to export the data to xml file so I have done this part using the resultsetmetadata But i did ...

37. arabic data from the database    coderanch.com

38. Getting data from database and storing them in Java collections    coderanch.com

Hi all, I was wondering which is the best Java collections that can be used to store the results from the data base. Could anyone point me to a link to any tutorial. If my database results are already sorted which collection can be use to store such data. Thanks in advance for your time and helpful tips With Regards Deepthi ...

41. What is the "standard way" when getting data from a DB?    coderanch.com

Hello, What is the standard way to get data from a DB in a scalable way? Currently I am using a script to pull out all details from a DB "where id=1", then looping through the "results.getString(i)" and putting them into a fixed length array before returning them to the servlet that requested the information. For example with the following code; ...

42. Java and database data type    coderanch.com

43. How to display data in browser window after writing it to DB    coderanch.com

Browsers are strictly request-response (i.e. "pull" mechanisms) but you can coax them into sending a request periodically and give the appearance of a "push". The easiest way is to have the "second" browser automatically refresh the page every so often. When it does so, your server responds with the changed data. Another option is to use AJAX (and DHTML/HTML5) techniques, where ...

44. Import Excel sheet data to database    coderanch.com

45. Retreive Data from DB thru Web Services    coderanch.com

Hi ALL, I am a new member in this forum and very excited to have registered to one the biggest Java Forums. I am very new to Web Services. Suppose,I am querying a web service by a method() say getPersonDetails() sending a request and getting the desired data as response and extract it using response.getPersonName() say. How the web service in ...

46. How to automatically classify data in a large database    coderanch.com

Hello, I am supposed to take data from wikipeadia dump or freebase dump or dbpedia. I am then supposed write code that gives as output what every datum in that database is. eg: name of a person or a bussines, address,... It does not matter in what language i write the code but, Im only familiar with C, C++, Java and ...

47. Sorting Data without a Database    coderanch.com

I would like to pull data fields from several database tables to create several records and then sort based on a couple of key elements. Hoping I can do this without having to feed that data back into the database? Can anyone recommend a data structure that would work best for this?

50. Unique datatype in database    coderanch.com

Also, if you want to avoid case-insensitive differences, you might consider "lower(userID) = lower(?)". Granted, some databases can be configured to always perform case insensitive matching. One issue with unique usernames is that even if you check ahead of time, a race condition could have two users creating the same record at the same time. It doesn't mean you shouldn't check ...

51. can any one suggest autocomplete plugins in which the data is retrieved from db ..?    coderanch.com

can any one suggest autocomplete plugins . I want to make a text box with autosuggestion feature ... i want to retrieve the data from the database Thanks. i hv gne thro many of them they use php files .i want sch that i can use them in jsp servlet. thanks .

52. Bean data not mapped to database    java-forums.org

Deployment descriptor for the bestellingsadministratie JOnAS example bestellingsadministratie example Deployment descriptor for the Order bean with CMP2 OrderBean org.colruyt.bestellingsadministratie.beans.order.OrderHome org.colruyt.bestellingsadministratie.beans.order.Order org.colruyt.bestellingsadministratie.beans.order.OrderLocalHome org.colruyt.bestellingsadministratie.beans.order.OrderLocal org.colruyt.bestellingsadministratie.beans.order.OrderBean Container java.lang.Integer false 2.x order orderid orderdatum orderstatusid leverancierid productid besteldehoeveelheid orderid findByNumber ...

53. Formatting String data from database    java-forums.org

54. How to automatically classify data in a large database    java-forums.org

Hello, I am supposed to take data from wikipeadia dump or freebase dump or dbpedia. I am then supposed write code that gives as output what every datum in that database is. eg: name of a person or a business, address,... It does not matter in what language i write the code but, Im only familiar with C, C++, Java and ...

55. Hi why is it my database never update/edit its data    java-forums.org

public class dbConnection { public dbConnection(){ try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con = DriverManager.getConnection(dbSearchUrl,dbSearchUser,dbSearchPassword); }catch(ClassNotFoundException cnfex){ JOptionPane.showMessageDialog(null, "Failed to load JDBC/ODBC driver."); cnfex.printStackTrace(); System.exit(1); //terminate program }catch(SQLException sqlex){ JOptionPane.showMessageDialog(null, "Failed to load JDBC/ODBC driver."); sqlex.printStackTrace(); System.exit(1); //terminate program } } protected Connection con; protected static final String dataSourceName = "psalmDSN"; protected static final String dbSearchUrl = "jdbc:odbc:" +dataSourceName; protected static final String dbSearchUser = ...

56. Need help returning data from database    java-forums.org

Hi everyone I want to return the results of a database query, and assign the values to variables. The data in the database is as follows: Item Price === ==== item1 10.00 item2 7.00 item3 5.00 I have float variables called item1, item2, item3, and I want to assign these variables the results from the query. This is the code I ...

57. How to store other languages data in DB    java-forums.org

59. API to fetch binary data in database    forums.oracle.com

We have a database in which there are 10 columns. Each of these fields contain binary data. This binary data represents values for 5 attributes. Details: There are 5 columns. Each column contains binary values. Binary value in each column is to be broken into 5 segments so that each of the 5 attributes can be mapped into it. Now, I ...

60. Displaying data from a database    forums.oracle.com

61. Problem in posting data to database.    forums.oracle.com

Sir, becoz i am on corporate network so cant' download any new database. and yes I am using servlet for this, which is fetching data from a bean. this bean earlier fetched the same data from a jsp page. How does thread safe relate with this imlicit bracket insertion problem i m facing?

62. storing data without using a database.    forums.oracle.com

Sir/mam I have to take data from a form and then store that data without using a database. now, again when user inserts next record...same servlet is called which stored earlier record....so the problem is how can i persist previous record and store next record in servlet because every time the servlet is called whole record previously stores is refreshed. I ...

63. Data types in DB    forums.oracle.com

64. how to get data from database?    forums.oracle.com

65. i want to display data form db to dropdown list box    forums.oracle.com

please, can U make it clear , ls that post was sarcastic ( I hope ) the short answer is: there isn't a short answer. your question isn't really "i want to display data form db to dropdown list box" it's "I want to learn how to write web applications using JSP and some database technologies". much larger-scope than can be ...

66. Adding data to database in Netbeans 5.5    forums.oracle.com

I'm new to netbeans 5.5 and I'm learning a lot about it but I have a question. I know how to add a component and link a database in netbeans, I even know how to get a field from the database and display in the text area, but I haven't been able to find out how to insert new data into ...

67. Unable to display data from access database    forums.oracle.com

68. Getting data from DataBase and displaying in browser    forums.oracle.com

import java.sql.*; import org.apache.xml.serializer.ToTextStream; import com.sun.corba.se.impl.oa.toa.TOA; public class JDBCQuery1 { // Format a string so that it has the specified width. private static String format (String s, int width) { String formattedString; // The string is shorter than specified width, // so we need to pad with blanks. if (s.length() < width) { StringBuffer buffer = new StringBuffer (s); for (int ...

69. how to get a session data and check against database    forums.oracle.com

yea i'm kind of close. but i cannot fully understand the picture i can do something like Object custlginname = request.getsession().getattribute("loginname") then i need to see this userID is there in matching to the tableXYZ that contain customerSHOPname and userID (this custshop is mapped to that USer ID) so what i need t do is see that table whether this usedID ...

70. fetching data from cosole into the database    forums.oracle.com

71. retrieved data from database assignd to object array    forums.oracle.com

Hi all, Im new to java. I creat class it has item_name,item_qty,item_price as properties.then i need to create object array type of that class.now i need to assign values to properties in each element of object array from the database.in my database has ITEM table it has data according to that properties of class.how i do this.please tel me . thanks ...

72. automatic send e-mail according to the expire data attribute in database    forums.oracle.com

Hi, everyone. I am now working a web library system, and I use MS Access as the database to store the data. Now I want to build a function for the system, which can automatic send loan expire message to the borrower when the expire data is met. I have search several days for this function and all the information is ...

73. how to extract data in a webpage to a excelsheet or back end DB    forums.oracle.com

Hi folks I'm kiran and i'm working as technical recruiter. previously i worked as a shadow associate with National Informatics center (A govt of india IT department) where i first tried my hands on JAVA and was amazed with the things which i could do. Now with my present company, where we are trying to build a recritment tool and I ...

74. Printing Data from Database    forums.oracle.com

I'm looking for the best approach to print some information from a database with a heading and some tabular information. I've been trying to print from and HTML formated page, a JFrame and PDF. I can format all these methods properly but printing them to paper via a physical printer has been a major problem. I've really found no way to ...

75. Help--Inserting Multi Select data into database    forums.oracle.com

[LEFT]Hi, Can Someone help me with this. Only one value is inserted into the Db when I tried to use the multiselect listbox and selected multiple values. I need all the values I select from a listbox to be comma separated and inserted in the coresponding Db column. I'm using the java for inserting the data into database. I've the following: ...

76. Store Excel data to the Database    forums.oracle.com

78. access data from database for only ticked checkboxes in front page    forums.oracle.com

Woah ... slow down. Please describe your requirement again, this time using something that more closely resembles english. It's very, very hard to read that and even after I could read it I still don't know what exactly it is that you want. And: You don't seem to be asking a question. What problem do you have with that requirement? And ...

79. Database access code in objects constructor, or in data access object    forums.oracle.com

not me. i don't want sql classes to leak out of my persistence layer. it's an interesting point to argue, because there are folks who would say that putting all the persistence code in a separate layer is "not object oriented". an object should "know" how to persist itself, right? i think it's likely that i'd want to use a base ...

80. Java program for reading data from DB and then sending a mail with attachme    forums.oracle.com

Hi all, Please provide me the sample code for: Java program for reading data from DB and then sending a mail with attachment in CSV format which contains all the data from database.: 1. I need to stream data from database into an CSV file and then have to send that file through file. 2. I need to stream data from ...

81. getting data from database    forums.oracle.com

82. Getting data from Database    forums.oracle.com

Hello All, I have a DAO layer to access the database I have to join 10 -12 tables in order to display data in my jsp page.With performance's point of view, is it better to break the query to 2-5 simple queries with less number of joins or get the entire data in one query. Help is greatly appreciated. Thanks

83. problem in getting data from database    forums.oracle.com

85. Uploading data to database from front end...    forums.oracle.com

87. Getting data from a database    forums.oracle.com

88. need help regarding displaying data from database to html page    forums.oracle.com

Hi to all, I am fetching data from database by using java code and didplaying the data that i fetched from database into html page in table format.But the time taken for fetching data from database and displaying it in html page is more .can i have any alternative to decrease the time taken to fetch and display it in html ...

89. Putting data in DB    forums.oracle.com

90. How to delete data in database if Close(X) button is clicked?    forums.oracle.com

Hi, I am using Netbeans Visual Web and Java DB Databse in my project. I want to delete user's data if the user click close (X) button in IE or other browsers. If I use onunload or onbeforeunload, it only gives alert or pops out a confirmation message. I can't delete the data in database since the code is written in ...

91. Reading data from database into an array    forums.oracle.com

93. Help-How to display data from db on selecting item from drop down list    forums.oracle.com

i have the following code in JSP file Display function gives selected item from drop down list. I require item variable to display corresponding data from database if i write statement <% out.print(item)%> item can not be accessible. why? how to access it in ...

94. How to download Data from Database directly into excel    forums.oracle.com

I have a requirement to download very large quantity of data from database into Excel file. But condition is excel file should have only 65,536 rows in a single spread sheet(that's the limit i suppose),if i have more data points(rows) than it should be stored into different spreadsheet.......this continues so there can be many spread sheets in a single excel file. ...

95. Database Access VS DataStructure in Memory    forums.oracle.com

My question to you: So what? What will the consequences be? Will the system be unusable when this somewhat unlikely situation occurs? In most situations that will not be the case; in the situations where it is the case, you simply don't keep the information in memory, or only for short periods of time (keyword to search for: "java web conversation"). ...