This week's book giveaway is in the Cloud forum.
We're giving away four copies of Terraform in Action and have Scott Winkler on-line!
See this thread for details.
Win a copy of Terraform in Action this week in the Cloud forum!

abheeshek reddy

Ranch Hand
+ Follow
since Nov 28, 2008
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 abheeshek reddy

abheeshek reddy wrote:hi all,

i am trying to insert date in Oracle DB using Spring MVC.

JSP Code



Shift Bean



Controller




In Console it is printing null ? how fix and how can i auto populate the date in UI.



5 years ago
hi all,

i am trying to insert date in Oracle DB using Spring MVC.

JSP Code



Shift Bean



Controller




In Console it is printing null ? how fix and how can i auto populate the date in UI.



5 years ago
hi all,

I have two requirements

1. parsing Excel file and insert excel data in to DB (oracle).
2. Transverse DB table structure to UI.

I am doing a small Project to maintain employee shift tracker, which we are maintaining in excel. below is the sample excel data, T1 represents time (6:00 am-4:00 pm) T2(12:00 pm-9:00pm) T3(9:00 pm-6:00 am)
Dateemp1emp2emp3emp4emp5emp6
01/July/2016T2T1T3T1T3T2
02/July/2016T1T2T3T2T1T3
03/July/2016T3T1T2T3T2T1
04/July/2016T1T3T1T1T3T2


Below is table script designed by DBA -- Is table design correct to get above view?



Any link or suggestion to upload excel data in to above table using spring MVC


I googled for Spring MVC and found one sample to edit employee details, however not able to design Shift Jsp. Below is the code i am planning to use.

Below is Bean


below is DTO class



Below is add employee Jsp



Bean and DTO are the key classes to get and put list of objects, hence requesting help on how i should modify the code to display.

thanks
Abhee
5 years ago
hi team,

I am looking for a utility framework or sample code which can be used to execute oracle queries from browser. (Insert queries).





thanks
Abhee
5 years ago

Dave Tolls wrote:
That's the bit you want to be checking if its null...not the getAsString() value.
If there isn't a "Release" value then there's nothing there to call getAsString on.




That's good catch, thanks Dave.
5 years ago

Dave Tolls wrote:The format is only for parsing a String to a Date.
Date objects do not have a format.

As for not having the seconds in the DB, how are you reading values out of the db?


What database is it?

--Oracle is the database.

What is the column type?



-- column is Date type
5 years ago
hi team,

i am trying to pull the data from Rally tool and some of the fields has nulls and i wrote below code to handle Exception and trying to insert default values.


I am getting null pointer exception, if i use below code.
5 years ago

Dave Tolls wrote:Can you post the full exception and stack trace?

Why are you parsing, formatting, and then parsing again?




thanks for your reply. May be i thinking too much and wrote some stupid code. After your comment, i modified the code as below and able to insert the data in date format.
i was trying to update the DB in yyyy/MM/dd hh:mm:ss. however with below code data is inserting in yyyy/MM/dd format. How can i pull time as well.



5 years ago

Dave Tolls wrote:Have you tried using SimpleDateFormat?
That's the class for turning a date string into a Date object.



thanks for prompt response.

Here is the piece of code i wrote. However while converting to sql date it is throwing casting exception.

5 years ago
hi all,

Please help on converting String to sql Date. i searched in java docs and couldn't find any relevant.

String s = "2016-11-30T06:24:45:760z"


thanks
Abhee
5 years ago

abheeshek reddy wrote:hi Guys,

I have a script to remove lower version jars files in a directory.


#!/bin/bash
#Script to remove lower version jar files.

for PREFIX in `ls *.jar|sed 's/-[0-9\.\0-9\.a-zA-Z]*\.jar//g'|uniq -d`; do
for FILE in `ls -r ${PREFIX}*|sed '1d'`; do
echo " $FILE"
rm $FILE
done
done




It has a bug and i need your help to figure and fix the bug.

I have below list of Duplicate jar files in a directory.

xyz-1.1.jar
xyz-1.1.1.jar
abc-1.6.jar
abc-1.3.jar
abc-xyz-pqr-1.9.6.jar
abc-xyz-pqr-1.9.2.jar
xyz-tom.jar
xyz-tom-20120423.jar
xyz-tom-20120410.jar
abc-toolkit-1.6-runtime-5.2.0.jar
abc-toolkit-1.6-runtime-5.0.0.jar

The bug is with xyz pattern jar files.
BUG: 1) Script is removing xyz-1.1.1.jar file instead of xyz-1.1.jar
2) Script is removing xyz-tom-20120423.jar and xyz-tom-20120410.jar files.


Thanks
Abhee

8 years ago
hi Guys,

I have a script to remove lower version jars files in a directory.


#!/bin/bash
#in a directory full of jar files, it is common to have multiple
#versions of the same jars. If versions are named with only periods
#and alphanumerics, then this groups the jars by the name, deletes
#all the lesser versions

#get a list of jars like x-1.0.0.RELEASE.jar, get only the jar name
#without version or .jar and get only non unique lines (ie., duplicate
#jars are found)
for PREFIX in `ls *.jar|sed 's/-[0-9\.a-zA-Z]*\.jar//g'|uniq -d`; do
echo $PREFIX
#now do a reverse sorted listing with the jar name and remove the
#top line so that non latest versions are returned
for FILE in `ls -r ${PREFIX}*|sed '1d'`; do
echo " $FILE"
rm -f $FILE
done
done



It has a bug and need your help to figure and fix the bug.

Scenario: Assuming i have two jars file in a directory with names xyz-1.1.jar and xyz-1.1.1.jar
This script is deleting xyz-1.1.1.jar (higher version) instead of lower version.

Thanks
Abhee
8 years ago

hi all,

i am trying to deploy a ear file in Jboss7 and i am able to view below warning messages and error message in console.

WARN [org.jboss.as.server.deployment] (MSC service thread 1-4) Class Path entry xercesImpl-2.2.1.jar in "/C:/Windows/System32/content/some.ear/some.war/WEB-INF/lib/fop.jar" does not point to a valid jar for a Class-Path reference.

ERROR [stderr] (http--127.0.0.1-9001-1) 09/26/12 13:52:44.958 IST DEBUG (Thread[http--127.0.0.1-9001-1,5,main]) [VersionManager] Using lib directory file listing for fetching classpath


i have gone through some forums and i couldn't get in to right direction. I read in one of the forum that Jboss 7 doesn't classloading is it true?

below is the entry for my class loading file

<classloading xmlns="urn:jboss:classloading:1.0" name="some.war" domain="jboss" export-all="NON_EMPTY" import-all="false" parent-first="true"> </classloading>


thanks
abheeshek
9 years ago

Jesper de Jong wrote:

abheeshek reddy wrote:The path has been set to my C:\Program Files\Java\jdk1.6.0_31\bin directory.


What the PATH is set to, is irrelevant for this question.

Ravi Vanamala wrote:Along with the PATH, try setting the JAVA_HOME=C:\Program Files\Java\jdk1.6.0_31 in environment "System Variables"


That's not going to solve anything either - the Java compiler and launcher do not use the JAVA_HOME environment variable at all.

NoClassDefFoundError means that your CLASSPATH is not correct, so that Java can't find a class it's looking for.

First, compile your source file with the command: javac SingletonDemo.java

If that succeeds without errors, check that you have a file named SingletonDemo.class in the current directory.

Then run it. Use the -cp option to specify the classpath; make sure the current directory "." is in the classpath:

java -cp . SingletonDemo




Thanks all it worked ... i resolved the problem by setting the current directory in classpath.
9 years ago

John Jai wrote:1. Please check if the .class file is present in the classpath
2. Hope you first compiled using javac before executing java command.





Thanks John for prompt response,
Usual practice is we won't set individual .class files in classpath. However, previously i used to set only path variable in system variables. if required i used set rt.jar file in class path.


thanks


9 years ago