manisha ankolekar

Greenhorn
+ Follow
since Nov 26, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by manisha ankolekar

No,I am not using any third party application.Actually its gui applicationn wherein user selects date and retrieves data from db.Here I have used a button which calls method below:



Cant get what is the problem???
Please tell me any alternate method to fill the table on button event.
thank you
16 years ago
How to populate Jtable with resultset.Is DefaultTableModel fine???

In my appln user on the form selects dateand based on that record displayed on the table on button event.But on button event I'm getting JVM error as:

An unexpected error has been detected by Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7c901010, pid=4080, tid=2660
#
# Java VM: Java HotSpot(TM) Client VM (1.6.0_03-b05 mixed mode, sharing)
# Problematic frame:
# C [ntdll.dll+0x1010]
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#

Any Help appreciated.......
16 years ago
The code I tried out:



Date d ;
Date d1;
DateFormat formatter,formatter1 ;
String s=cbDate.getSelectedItem()+"-"cb.getSelectedItem()"-"+cbYear.getSelectedItem();

String e=cbDate1.getSelectedItem()+"-"cb1.getSelectedItem()"-"+cbYear1.getSelectedItem();
try
{
formatter= new SimpleDateFormat("dd-MMM-yy");

d = formatter.parse(s);

System.out.println("d "+d);

d1 = formatter.parse(e);

System.out.println("d1 "+d1);
String sql="Select nofrom tble where aDate>= ? and aDate<=?";
pstmt=cn.prepareStatement(sql);
pstmt.setDate(1,new java.sql.Date(d.getTime()));
pstmt.setDate(2,new java.sql.Date(d1.getTime()));
rs=pstmt.executeQuery();
while(rsOrders.next()){
System.out.println(rsOrders.getString("no"))}
}

catch(Exception ex){}



No results
Please Help me with the code to find records between start date and end Date provided from ComboBox.

The date column in database is of Date/Time itself.I'm using MS Access db.
Thanks for the reply
Can You please tell me how should I convert the Text into date

Please help
Thanks
I have used a JcomboBox as
cbProducts.FillCombo("Select * from pTable");

Here FillCombo is function to add items from database table.the outline is:

public static JComboBox FillCombo(String sSQL,Connection conn,String sFieldname)
{
//code to add items
}

Now i have added ItemListener to this combobox as cbproducts.addItemListener(this);

On event I wnt the selected Item in TextField so in listener I wrote:

public void itemStateChanged(ItemEvent e)
{
if(e.getSource().equals(cbProducts))
{
if (e.getStateChange() == ItemEvent.SELECTED){
String i=cbProducts.getSelectedItem().toString();
System.out.print(i);
cbProducts.removeItemListener(JBItemListener);
sSql="Select * from tblProducts where ProductName like '"+i+"'";
int index=cbProducts.getSelectedIndex();
txt.setText(i);


cbProducts.removeItem(txt.getText());

cbProducts.addItemListener(JBItemListener);


}
}
}


But the problem is when I run this code,the zeroth element cannot be selected at first run i.e if I want to select 1st element .I need to first select second or third record and then select first record.

why I am getting this problem and also I'm unable to remove the selected Item from combobox.

Please help
Thank You
16 years ago
I have witten SQL query as:
"Select * from tbl where date between 'Jan 2 2008' and 'Feb 28 2008'";

Records in table are:

Name Date
aaa Jan 5 2008
bbb Jan 26 2008
ccc Jan 26 2008
ddd Feb 27 2008


Now when I run this query I get only last record i.e

ddd Feb 27 2008

When I run query as

"Select * from tbl where date between 'Jan 1 2008' and 'Jan 31 2008'";
I get all records inculding Feb ones ie

Name Date
aaa Jan 5 2008
bbb Jan 26 2008
ccc Jan 26 2008
ddd Feb 27 2008

I'm using MS Access db and I have kept date field with Text data type

I'm not getting why this problem is occuring.
Please help
thank you.
Hi........I am working on my project.I want to validate value entered in TextField is year(using YYYY/Mon/DD format).how I should do it.

Also how to validate input enterec in Textfield is Number

Pls help.
16 years ago
Please suggest me Books that I should refer for taking up SCJP1.5 Exam.Also sites for downloading mock test and simulators would be useful.

I am new to this forum so I have no idea whether this Topic has already been posted
Accepting Help from members of this forum
Thanking You All
[ November 27, 2006: Message edited by: manisha ankolekar ]
Pls explain why does the following code generates Compile-Time Error

String a="\u000a";//Unicode value for NewLine

String b="\u000d";//Unicode value for Carriage Return

My second question is:Wat is the use of Carriage Return???

Also explain why doesnt this code generate Error


String c="\u0008";//Unicode value for Backslash

String d="\u0009";//Unicode value for Tab

Pls help
Thank u