473,461 Members | 1,505 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How I can solve the out of memory Exception in my java project?

2
Expand|Select|Wrap|Line Numbers
  1. public class FRM_admin extends javax.swing.JFrame {
  2.  
  3.     /** Creates new form FRM_admin */
  4.     public FRM_admin() {
  5.         initComponents();
  6.         FRM_admin frm=new FRM_admin();
  7.         frm.setBackground(new Color(30,17,55));
  8.         Display_record();
  9.     }
  10.     private void Display_record()  {
  11.         {
  12.  
  13.          Statement st;
  14.          ResultSet rs;
  15.         DefaultTableModel model=new DefaultTableModel();
  16.         model.addColumn("Dispatch no.");
  17.         model.addColumn("Name");
  18.         model.addColumn("Contact");
  19.         model.addColumn("Email");
  20.         model.addColumn("Address");
  21.         model.addColumn("Quantity");
  22.         model.addColumn("Price");
  23.         model.addColumn("Complaint no.");
  24.         model.addColumn("Problem");
  25.         model.addColumn("Date of Complaint");
  26.         model.addColumn("Status");
  27.         model.addColumn("Warenty Time");
  28.  
  29.         try
  30.         {
  31.               // Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
  32.             Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
  33.             Connection con=DriverManager.getConnection("jdbc:odbc:Admin");
  34.           //   con=DriverManager.getConnection("Jdbc:Odbc:ra");
  35.            st=con.createStatement();
  36.            rs=st.executeQuery("select * from Admin");
  37.           //  rs=st.executeQuery("select * from Admin");
  38.            while(rs.next())
  39.            {
  40.                model.addRow(new Object[]{rs.getString(1),rs.getString(2),rs.getString(3),rs.getString(4),rs.getString(5),rs.getString(6),rs.getString(7),rs.getString(8),rs.getString(9),rs.getString(10),rs.getString(11),rs.getString(12)});
  41.            }
  42.            jTable1.setModel(model);
  43.         }catch(Exception ex)
  44.  
  45.         {
  46.             ex.printStackTrace();
  47.         }
  48.     }
  49.  
  50.  
  51.     }
  52.  
Sep 21 '10 #1
3 1826
Dheeraj Joshi
1,123 Expert 1GB
Increase JVM heap size. This should solve your problem.

How many record are present in Admin table in DB?
You can do some sort of optimization.

Regards
Dheeraj Joshi

Related thread discusses this issue.
Sep 21 '10 #2
jannat
2
Only 5 records are present
Sep 21 '10 #3
Dheeraj Joshi
1,123 Expert 1GB
What is the heap size you have set?
How many values are present in Result Set?

Regards
Dheeraj Joshi
Sep 21 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Jane Austine | last post by:
>Jane Austine wrote: >>>>from Tkinter import * >>>>>r=Tk() >>>>>b=Button(r,text='Quit',command=r.quit) >>>>>b.pack() >>>>>r.mainloop() >> >> >> And when I press the "Quit" button the mainloop...
21
by: Stephan | last post by:
why does the following code not work???? after compiling and running it will just say killed after all my memory filled up any suggestions? #include <iostream> using namespace std; void...
7
by: Aravind | last post by:
Hi, I am ruuning to out of memory exception , My system has RAM of 4 GB and virtual memory paging size set to 4GB .When I check the memory occupied by the process during the exception , it is less...
2
by: PVV30 | last post by:
Hi, I am currently involved in development of customer database. This database contains around 150,000 records. We have a search screen where users may search customers. However when search to...
10
by: 123456prakash | last post by:
Hi all , I am new to this . This is my first post . I really need some help from you all members of this forum. My situation is something like this . I am communicating with 2 system .Both the...
2
by: tejal | last post by:
HELLO I have developed some modules in java,executing them causes out of memory exception. When i m trying to increase heap size in jdk 1.4 or jdk 1.5 i m getting following error. Invalid...
2
by: =?Utf-8?B?SXJmYW4=?= | last post by:
Hello, It may be a repeated question but I don't find the solution to the situation that I encounter in it. My application is monitoring another application that is built in VB6. The...
1
by: Meiaad | last post by:
I have a java project. this project is stock market monitoring system. our jop is to download the source of the html page using eclips. and i success to do that but the problem is how can i search...
2
by: josephx | last post by:
Hello, I got some of these errors listed below after executing an HTTP Post MIDlet on CLDC/MIDP platform, "Nokia S40 DP 2.0 SDK 1.1" and "S40 5th Edition SDK Feature Pack 1" and even for S60's...
1
by: annazpereira | last post by:
Hi, I am new to java and cannot fiugre out what is wrong with my code. I keep getting the following error: Upgrade.java:133: unreported exception java.lang.Exception; must be caught or declared to...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.