Anand Karia

Ranch Hand
+ Follow
since Sep 25, 2004
Anand likes ...
Java
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
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by Anand Karia

Oh Yah.... Sorry I forgot.

Thank you a lot Martin.
Dear All

I have 5 column
1 Col = Code numeric [ 1,2,3 ]
2 Col = Name varchar [David, Anand, Peter ]
3 Col = Salary numeric [ 5000,6000,70000]
4 col = factor char [ * , * , / ]
5 Col = rate numeric [ 10,10,0.5]

How can I use column # 4 in SQL query. Please help.

i.e. select code,name,salary, (salary + factor + rate) as amount from salary_table . This query is not working


First of all i would like to tell you that MS-Access database is used specially for single computer. But like in your case you can use single database for multiple users.

Secondly, There are two different ways to connect to MS-Access database. Either you connect database using DNS entry into Windows PC, or you define the exact path of database.

In your scnario, i would prefer using DNS entry into database.

For instance, If you want you all clients to be connected with same single database then put that .mdb file into server and share it fully and allow access to each and every client.
Make dns entry into each computer and select the shared .mdb file.

While using DNS entry, software will use same database.

Hope this scnario will help you out.
Dear Paul Sturrock

Thank you very much. I remove sqljdbc4.jar file and use only jTDS.1.2.5.jar file and make a connection from it. It work perfectly.

Now my application can easily be executed for Postgresql, MS-SQL without making any single code change.

Thanks you very much.
I am using netbeans ide with MS-SQL 2000 Server. My problem is that

When I am using

Data is shown on command prompt but when i am using rs.first() or rs.Previous() or rs.last() then it shows error on it
com.microsoft.sqlserver.jdbc.SQLServerException: The requested operation is not supported on forward only result sets.

BUT WHEN I CHANGE THE STATEMENT LIKE

com.microsoft.sqlserver.jdbc.SQLServerException: The TDS protocol stream is not valid.

OR WHEN I CHANGE THE STATEMENT LIKE

com.microsoft.sqlserver.jdbc.SQLServerException: The TDS protocol stream is not valid.

OR WHEN I CHANGE THE STATEMENT LIKE

com.microsoft.sqlserver.jdbc.SQLServerException: The requested operation is not supported on forward only result sets.

OR WHEN I CHANGE THE STATEMENT LIKE

com.microsoft.sqlserver.jdbc.SQLServerException: The TDS protocol stream is not valid.

LAST but not least: While using INSERT,UPDATE,DELETE cnn.createStatement() is working perfectly.

I am using following jar files
sqljdbc4.jar
jtds-1.2.5.jar


I do not know where i make mistake? Can anybody please help me out in solving this problem.
David Newton

I would appreciate if you could guide me a bit in code means how and where to write it.
I wrote following lines but it shows error to me.
java.io.OutputStream outputStream = response.getOutputStream() ;
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
Dear All

First of all i would like to inform that I am new to jsp.

I have code jsp with database and jasper report. It shows very well with my server.
But when i am connecting through my client computer it shows the html file only and report is generated at server.

I do not know where i made mistake. Can any body help me out.

GO to Code tab.
At Form Size Policy:
Make it to Generate Resize Code

Click onto form and Slightly change your form. You will see a change in "Form Size",the second option at Code Tab.

Enjoy...........
9 years ago
To start working on Netbeans use the following steps.

Create jFrame Form.
Right-Click on the form and make Layout as NULL via popup menu.
Now you can place your button or text etc etc as per your layout.


Right-Click form and go to property
Go to Code Tab.
Change form to Re-Size

Enjoy..................
9 years ago
Can anybody reply me where i make changes in any of the three example.
10 years ago
Dear Maneesh Godbole

Thank you very much for replying me but i want to let you know that i have done the same but could not get the result. Can you please send me code/example?
10 years ago
Can anybody please tell me where i am wrong. Image on jTable is not displaying.

3 Button and 3 methods are called on button click event.



THE RESULT ON JTABLE IS "javax.swing.ImageIcon@b89838"






IMAGE SHOWN ON LABEL BUT ON TABLE IT SHOWS "javax.swing.ImageIcon@112f614"




HERE RESULT SHOWN ON JTABLE =
BufferedImage@1d9dc39: type = 5 ColorModel: #pixelBits = 24 numComponents = 3 color space = java.awt.color.ICC_ColorSpace@93dcd transparency = 1 has alpha = false isAlphaPre = false ByteInterleavedRaster: width = 166 height = 202 #numDataElements 3 dataOff[0] = 2
10 years ago
Thanks i will test this by setting he flag.But if there is two or more thread it will work, at this time how to make the particular thread to pause


For every thread class, for stopping and resuming thread you need flag that cause to make them enable to run and stop according to your need.

Thread.sleep( ); This will make your thread class to stop for a while (in miliseconds) you have given in between Thread.sleep(200)

If you can post your code here then we can easily tell you where you can make/place flag(s).

Hope this can help you out.
Dear All

Touch Screen Time and Attendance Project overview:
==================================================
Operating System : Windows
IDE : Netbeans
Database : Postgres
Project Name : Time and Attendance
Webcamera : Creative Webcam

Coding Details
==============
Main form = barcodeScanning_1.java
Time class extended by Threads = myCurrentServerTime.java
Webcam class extended by Threads = t1.java with t2.java
other t2.java is used for webcam form and to set and get live picture from webcam.

When user start entering their token no then webcam starts processing. It take picture from a path and live picture from webcam and store into another path and at end report is generated with live picture.

Problem:
========
Wht problem i am facing is that i can not run both threads at one time. When i tries to run them using Thread.sleep(2000) method or boolean = true/false my CPU speed goes to 100% and webcam images doesnot appear on screen only black screen is coming and my form hangup due to continue processing.

So finally i stop one thread and run only webcam threads with the click of button. Means when user start touching token number my threads get start and when punch button is press then my threads stop and it get data from database and shown on form.

But problem is that when my thread runs CPU process goes to 100%. and delay of taking live pic from webcam comes out and employee starts getting late.

Here is my code for webcam threads, kindly suggest me where am i wrong and how can i reduce my CPU process and how can i get live picture without delaying.










Dear All

First i would like to inform you that rs.next() is already written.
Finally when i change my jdbc driver from old one to new one then it show me correct result.

But this is really imazing that one form is getting result without any error from same old jdbc driver and another form is not. If i found any solution that why this problem has occur then i will definately post it here, if opssible.

Anyhow my this problem have been solved out through changing of jdbc driver.

Thank you all.