Nazmul Bhuiyan

Greenhorn
+ Follow
since May 23, 2002
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 Nazmul Bhuiyan

I�m getting the following Error:

Unable to invoke method listenerSubmit on com.fujitsu.efi.web.pages.InfringementsMaint$Enhance_12@bb6255[InfringementsMaint]: org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save(): com.fujitsu.efi.infringement.model.EfiInfBatch



How should I set composite ids here? I�m setting both the id manually in my java. What about the EfiInfBatchId in EfiInfBatch class?



The efi_inf_batch table looks like:






Thanks a lot to you all. Just give you more details:
In my program I'm getting a date and would like to see if the user entered date is greater then 12 months. For example user enters their date of birth and I would like to do some thing if the date of birth is greater then 12 months.
Thanks
Nazmul
16 years ago
Do do I compare one date that cannot be greater than 12 months older?
Thanks
16 years ago
I�m getting a clob object from the database and converting to string by getSubString(pos, length) and displaying string in the screen.

But need to convert the string to clob to store back to database.

I've looked in the API but couldn't figure this out by self.

Thanks

Naz
My XML document passed XSD validation but fails loading into the other system that only accept date and time without milliseconds and time zone.

I've Calendar date and when I'm setting the date/time to XML document it is setting date as <date-created>2007-05-03+12:00</date-created> with the time zone and time as <time-created>10:00:00.000+12:00</time-created> with milliseconds and time zone. I know it is a valid date according to the W3C.
How do I set date without time zone i.e. <date-created>2007-05-03</date-created> and the time without the milliseconds and time zone i.e. <time-created>10:00:00</time-created> what I need to do?

I'm getting the Calendar date through hibernate and setting date and time though XMLBeans.
Hibernate reverse engineering generates POJO i.e. Person.java and DAO PersonHome.java.
How do I use method findById(id) of PersonHome.java to get the Person details form the database?
I can use the method of my own DAO.
Some code example would be helpful.

Regards
Hi,
I'm trying to generate XML beans using a xsd provided by 3rd party and getting the following error. When I put escape character for '-' then it generates XMLBeans without any error. 3rd party says that their XSD is ok.
Can some one please advise me why this is failing and why '-' needs to be escaped?

E:\eFileWorkspace\eFileInterface\xmlBeansCompile>createXMLBeans.bat
Compiling eFile schema and building xmlBeanEFI.jar

E:\eFileWorkspace\eFileInterface\xmlBeansCompile>setlocal

E:\eFileWorkspace\eFileInterface\xmlBeansCompile>SET JAVA_HOME="C:\jdk1.5.0_04"

E:\eFileWorkspace\eFileInterface\xmlBeansCompile>scomp -src .\src -javasource 1.5 -out ..\lib\xmlBeanEFI.jar eFIBatchFile1501.xsd createXMLBeans.xsdconfig
E:\eFileWorkspace\eFileInterface\xmlBeansCompile\eFIXMLFile1501.xsd:169:4: error: pattern-regex: The regular expression '([\.a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(([a-zA-Z0-9_-])*\.([a-zA-Z0-9_-])+)+' is malformed: '-' is an invalid character range. Write '\-'.
Time to build schema type system: 1.437 seconds
BUILD FAILED
E:\eFileWorkspace\eFileInterface\xmlBeansCompile>
Thanks guys.
I just found a way to do this by reseting the system property to "\r\n"
System.setProperty("line.separator","\r\n");
I am wating to see whether it pass test or not.
20 years ago
Sorry about that short problem description.
I am creating files where each line would be 128 bytes and should be terminated with a <CR/LF> (0D0A, designated as type H for hexadecimal).
I am creating this file in UNIX but will be used in Windows PC.
I need a platform independent way to add <CR/LF> at the end of each line.
I am using BufferedWriter for that as follows:
public void write(String str) throws IOException {
writer.write(str);
}
I�m passing a String into the writer to write it.
I want to pass another String that will add platform independent <CR/LF> at the end.
I could do it in the write method like:
public void write(String str) throws IOException {
writer.write(str);
writer.write(<CR/LF> // ???
}
Or pass with the String to the write method that will contain the <CR/LF>.
I tried (\u000D, \u000A) to assign to a String but java doesn�t like it.
Can you let me know how to solve this?
Thanks
20 years ago
Hi,
I am writing a line and want to put curage return and a line feed at the end that would be flatform independent.
I tried "\r" for CR butthis adding ^M at each line
Can any one help me out?
Thanks
20 years ago
I have been searching for the topic mark and reset and found no exact answer for this. One solution was to recreate the reader. But what about If I don't want to create a new object?
I just copied this from previously posted by Paul Keohan, posted November 11, 2002
Can any one let us know how to use mark and reset please?
When using the readLine() method of BufferedReader to trace through the lines of a file, how can I 'reset' the file to go back to the beginning? The reset() method requires a 'mark' which is set up with a mark(int readAheadLimit) method. All I want is to return to the start of my file without having to create a new object.
20 years ago
Hi,
Can anyone give me some example code that would help me achieve the following?
1.Read few pipe delimited files from one directory.
2.Write to a file that will contain data from the previous file and some hard coded zeros, space or something else in a flat file.
3.Then put these newly generated files into another directory.
For example:
HDR|101707|20010130|TEST|1|||||||||||||||||||||||||||
to
HDR10170719NN00000185000 test 000000000670185000379NY00670
Thanks
20 years ago
Yes you are right but my question is why the resultSet is unll?
Yes I got the right SQL and is running ok in the database properly.
But when I am running it through JDBC then I am getting null result set.
What I did is:
1. Create the temp table by one sql
2. Insert date by another sql
3. and then update that table couple of times by different SQLs
4. Then select * from that temp table
I executed query 1, 2, 3. When I tried to executeed query 4 and I am getting the resultSet null.
Please help
It compiled fine and having the following error during runtime. If you see the following error then you will see resultSet is null.
It is giving me nullPointerException during closing the resulSet as there is nothing to close.
BUILD SUCCESSFUL
Total time: 6 seconds
C:\javaDevelopment\projects\gliInterfaces\dev>ant
Buildfile: build.xml
compile:
[javac] Compiling 1 source file to C:\javaDevelopment\projects\gliInterfaces\dev\build\classes
run:
[java] SQL to get Cash Lodgement data :
[java] select * from tmp_pscmLDG order by lodgement_no;
[java] executing statement:.............
[java] rs.close() : null
[java] java.lang.NullPointerException
[java] at com.peace.interfaces.PSCashManagementController.writeCashLodgements(PSCashManagem
entController.java:285)
[java] at com.peace.interfaces.PSCashManagementController.process(PSCashManagementControlle
r.java:101)
[java] at com.peace.interfaces.PSCashManagementController.main(PSCashManagementController.j
ava:73)
[java] at java.lang.reflect.Method.invoke(Native Method)
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:208)
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:150)
[java] at org.apache.tools.ant.taskdefs.Java.run(Java.java:415)
[java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:163)
[java] at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
[java] at org.apache.tools.ant.Task.perform(Task.java:319)
[java] at org.apache.tools.ant.Target.execute(Target.java:309)
[java] at org.apache.tools.ant.Target.performTasks(Target.java:336)
[java] at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
[java] at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
[java] at org.apache.tools.ant.Main.runBuild(Main.java:610)
[java] at org.apache.tools.ant.Main.start(Main.java:196)
[java] at org.apache.tools.ant.Main.main(Main.java:235)
[java] Program run took 2 seconds.
core:
BUILD SUCCESSFUL
Total time: 9 seconds

Part of my code:
System.out.println("SQL to get Cash Lodgement data : \n"+ sb.toString() +"\n");
getConnection();
Statement stmt = connection.createStatement();
rs = stmt.executeQuery(sb.toString());
System.out.println(" rs: "+ rs);