java_guy
115 questions
1
votes
3
answer
8.5k
views
Returning Cursor in MySQL
How do we return a cursor from MySQL Stored Procedure (Routines). Or another approach to return a list of values back to a Java program from the MySQL Proc. We are trying to implement the similar functionality as Sys Ref Cursor in Oracle and looks like there is similar thing in MySQL. But wondering...
1
votes
0
answer
72
views
IBM JSR 352 joblogs empty
I run IBM JSR 352 java batch application on Websphere Liberty Profile server. The application used to write job logs, e.g.
C:\web servers\liberty_profile\wlp-javaee7-17.0.0.1\wlp\usr\servers\javnat-batch-server\logs\joblogs\Job1000\2018-05-24\instance.19401\execution.19401\part.1.log
part.1.log cont...
1
votes
0
answer
41
views
How to retrieve decision id of IBM JSR 352 JSL
I run IBM JSR 352 batch job under Liberty Profile server. My JSL contains decision, e.g.
I have tried to retrieve the id of the decision from decider/batchlet but with no luck. It is not inside JobContext or StepContext. Does any of you guys know how I can retrieve it? Thanks a bunch!
1
votes
1
answer
141
views
How to apply bootgrid filter?
I have a bootgrid table with large number of rows. Is it possible to apply filter on the table?
e.g. each row has an attribute, say type. I want to display type='A' rows only.
many thx
steve
1
votes
1
answer
1.6k
views
How to Timing out java.sql.ResultSet
The PL/SQl cursor was getting hanged due to some reason, this makes my app to hang when try to loop through the ResultSet.
Is there a way to handle this, like timing out the resultset if the database hangs?
1
votes
1
answer
3.2k
views
Jboss Server Exception
Jboss server was throwing an Exception all of a sudden 'You are trying to use a connection factory that has been shut down: ManagedConnectionFactory is null'. No changes made to the datasources, prior to this. Everything got normal after a server bounce...
What are all the possibilities for this?
1
votes
1
answer
3.1k
views
Multiple Instances of <C:if / Choose /When> condition to be made as one
1: I have a JSP with multiple html 'TR's'
's
My page
...
This is first line
This is Second line
This is Third line
This is Fourth line
This is Fifth line
...
2: Now I am getting user session (if logged in). Note>>:Using Liferay themeDisplay here
3: I made a check to see if its guest or registered/lo...
1
votes
1
answer
3.3k
views
Using regular expression in Ext Js VType
I have a regular expression for checking numbers and allowing '-' (Hyphen) Text Field.
var regex = /^\d+-\d{1,2}$/; //Checks 'digits-digit(s,1 or 2)'
This works ok for regular HTML text field. But if I want a Ext Js TextField I have to do the below code
Ext js TextField and called a VType
var issue...
1
votes
2
answer
393
views
Regex doesn't work properly
I am trying to implement a regular expression to allow only one or two digits after a hyphen '-' and it doesn't work properly. It allows as many digits as user types after '-'
Please suggest my ExtJS
Ext.apply(Ext.form.VTypes, {
hyphenText: 'Number and hyphen',
hyphenMask: /[\d\-]/,
hyphenRe: /^\d+-...
1
votes
1
answer
86
views
Weird jibberish after File IO
I am writing an applet to wrap a proprietary .dll that can be used in the browser. To achieve this, I am using JNA. The .dll connects to a check scanner peripheral, and can pull images from the devices memory.
I have to make a Windows API call in Java, using JNA, to get the image:
// DEVICE is the...
1
votes
1
answer
1.3k
views
Writing JSTL code for JavaScript
I have a stand alone JavaScript which would plot a graph.
var chart;
var chartData = [
{country:'Tâches',a:25}, //this is the chart data
{country:'UK',a:25},
{country:'Fran\u00E7ais ',a:25 } ];
window.onload = function() {
chart = new AmCharts.AmSerialChart();
chart.dataProvider = chartData;
chart...
1
votes
1
answer
272
views
How to merge two jQuery Datepickers
I have two datepickers with different id and name. Can I merge them both and remove the redundant code?
jQuery(function() {
jQuery( '#other_date' ).datepicker({
showOn: 'button',
buttonImage: '/html/themes/control_panel/images/common/calendar.png',
buttonImageOnly: true,
changeMonth: true,
changeYea...
1
votes
1
answer
174
views
Error while reading XPath value
My response looks like below
24554691755043
0
Success
I need to read the partner customer number using xpath. I used
/Response/PartnerCustomerNumber and //PartnerCustomerNumber
Both returned be error saying Error parsing source entry[error:Unexpected element:CDATA]
How can I bypass CDATA to go ahea...
1
votes
4
answer
116
views
Break a special character in MySQL
I have a requirement where I need to check a pipe | in the database. If found I need to play around differently.
Here how my db table looks like //Please check the | character in row 11
And if I run a group by sql command myresult will be
Which is correct.
But my requirement is to break the | in...
1
votes
1
answer
30
views
Can my JDK and Weblogic be in different directories
I have my java jdk installed here
C:\ProgramData\Oracle\Java\javapath\java.exe
And my Weblogic is here
E:\bea
Do I need to run my JDK in the same E drive or not required?
1
votes
1
answer
47
views
How to get array data from HTML form?
I have a form in HTML, and it stores data into array structure.
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
Supposed I need to get the second kid's weight value, how should I do? I have tried:
$_POST[row[2][kidweight];
$_POST['row[2][kidweight'];
1
votes
2
answer
0
views
On Submit - Check at least one checkbox
I have multiple check boxes. When the Submit button is clicked I want to check if at least one checkbox is selected. Its not working
function doSubmit(){
function check_checkboxes()
{
checked=false;
var c = document.getElementsByTagName('input');
for (var i = 1; i < c.length; i++)
{
if (c[i].ty...
1
votes
2
answer
193
views
How to retrieve all localStorage values
I have used localStorage['key'] and key being different strings to store my values while developing my app.
Now I don't even know what all keys I have used.
Is there a way to retrieve all key's and its values from my file system?
And is there a way to drop the entire localStorage?
1
votes
3
answer
3k
views
json_encode(array) insertion in db
My array has some values
0 => '1'
1 => 'moisturizer'
2 => 'skincare'
I am trying to convert that array to string, I am currently using json_encode
$value = array_shift( $val_ary ); //val_ary is that array
echo json_encode($value); // This will echo my data like
['1','moisturizer','skincare']
later I...
1
votes
2
answer
1.7k
views
Callback for Android refreshCurrentAccessTokenAsync in Facebook Android SDK 4.1+
In Android, I'm calling refreshCurrentAccessTokenAsync() but there doesn't appear to be a callback. I've registered callbackManager before invoking refreshCurrentAccessTokenAsync() and it never gets called, and neither does onActivityResult.
Doc doesn't say anything either:
https://developers.faceb...
1
votes
2
answer
644
views
Change Date Time on my server and revert it back after testing
I am using date -s '..' to change my date and time.
date --s 'Friday, March 11, 2016 12:00:00 PM IST'
I get the following error..I guess I am on Linux..Solaris..not sure what argument(plug) it uses internally for date..
date: illegal option -- set
usage: date [-u] mmddHHMM[[cc]yy][.SS]
date [-u] [...
1
votes
3
answer
5k
views
java.lang.NoClassDefFoundError: happens sporadically on Resin sever start up
java.lang.NoClassDefFoundError: happens sporadically on Resin sever start up
This is on Resin 3.0.21
Using Java 1.5 on Linux machine...
I have a servlet defined on the web.xml to load the log4j.properties.
This is thrown when the servlet is trying to load on start up..
log4j-init: init log4j:ERROR...
1
votes
3
answer
1.2k
views
Import custom taglib
We usually give reference to external taglib as
Can we define our custom taglib and uri in our jsp as below?
1
votes
3
answer
618
views
Add input types on random
I have a input type number. Once the user enters the number in that field. I want to generate that many input types under it. How can I do it with javascript or Ajax for that matter.
No of Plans:
//using AUI here to check if numbers only
//If the number is 5 say. I need to generate 5 input fields un...
1
votes
1
answer
1.8k
views
Can a read a file from Tomcat Temp folder
I am reading byte data and writing a pdf file to my tomcat temp folder
FileOutputStream fos = new FileOutputStream(File.createTempFile('dummy-file', '.pdf'));
The file is written successfully.
In a later stage on my application I need to be able to read that file. Can I read any file directly from t...
1
votes
1
answer
4.5k
views
XML Schema Choice - choose at lease one, but no repeat
How can I enforce to chose at lease one, but no repeat?
The following syntax allows any c element to repeat up to 3 times.
thnx
steve
1
votes
1
answer
5.5k
views
MongoDb - Idle connection timeout
I don't see an option among the (MongoClientOptions) to set a timeout for idle connections from the application to MongoDB. We see that connections opened to the mongodb remain open for hours. How this handled in mongodb, is there any options to set idle connection timeout in mongo?
http://api.mongo...
1
votes
1
answer
2.3k
views
JavaFX+JSSC(Java Simple Serial Connector) thread communication
I am working on a barcode scanning project. I use a barcode scanner to scan barcodes and the scanner communicates with my laptop via bluetooth. The bluetooth connection is emulated as the serial port communication.
I have developed a Java desktop application to retrieve the barcodes scanned and disp...
1
votes
2
answer
2.3k
views
setAttribute is not working in JavaScript
I am using setAttribue as below. Its working only for first time and after that the changing value is showing the alert but not setting with document.getElementById('to').setAttribute('value', selValue);
document.getElementById('listcontact').onchange = function () {
var selIndex = document.getEleme...
5
votes
1
answer
5.4k
views
gdata-java-client + oauth2 + access_token secret
I'm currently trying to use the new java client(s) and due to legacy reasons for current state of google libraries, I need to use both the gdata and the new google java client api.
Obviously I'd like to use OAuth2 -- however with OAuth2 I am not getting the access token secret -- which causes an is...
20
votes
2
answer
15k
views
Lame MP3 Encoder compile for Android
I want to compile the lame encoder for Android. How can I find the tutorials for Lame and its compiling for Android platform.
Thanks,
5
votes
2
answer
10.3k
views
How do I alter my existing table to create a range partition in Oracle
I have existing table which has 10 years of data (I have taken dump).
I would like to Range partition the existing table on one date key column within the table.
Most of the examples I see are with CREATE TABLE..PARTITION BY RANGE... to add new partitions. But my table is existing table.
I assume I...
2
votes
1
answer
5.5k
views
@RequestMapping error for RenderRequest
I am trying to do RequestMapping for my portlet RenderRequest
@RequestMapping('view.jsp', params='test')
public void doSome(RenderRequest request, RenderResponse response){
}
But I get multiple errors like
Multiple markers at this line
- Syntax error on token ''view.jsp'', invalid MemberValuePairs...
3
votes
3
answer
113
views
How to access HTML array object in javascript?
sorry for asking simple question. I am really a beginner in Javascript. I need to access my HTML array form object in my javascript, but I don't know how to do it.
The goal is to trigger the alert in javascript so the browser will display message according to the condition in javascript. Here is my...
3
votes
2
answer
2k
views
Explaining hashcode to Vector
Can I get an idea of how the hashcode takes the valueas per the element added to vector?
Vector v = new Vector();
//Add elements to Vector
v.add('1');
System.out.println(v.hashCode());
v.add('2');
System.out.println(v.hashCode());
v.add('=');
System.out.println(v.hashCode());
The hashcode values are...
4
votes
2
answer
3k
views
Simple print example
I need to provide a print link on my simple html page.
When the user clicks on that, I want a pop-up which displays a print preview and the system printer should come up. I guess something with window.print(); option, but this directly gives the window print option without the preview.
I want the pa...
2
votes
2
answer
4.6k
views
3
votes
5
answer
81
views
javascript read first five values
I am fetching some values in a forEach clause
data.forEach(function(content){
...
controller.setAttribute(value from data);
...}
This works for me. But data loop iterates for close to 20 times. And my controller can take only 5 values. Hence my controller in above example is taking last five values....
5
votes
2
answer
18.4k
views
Invalid max count in grep function
If I do a find . -mmin -1 I get 'myfile' which was modified in last one minute.
But when I want to search a particular string in that file by doing
grep 'myString' myfile -mmin -1
I get the error invalid max count
I also tried
find . -name 'myfile' -exec grep 'myString' myfile -mmin -5
I get the e...
2
votes
1
answer
20k
views
Indian pincode validation regex - Only six digits, shouldn't start with `0`
I have tried Regex accept numeric only. First character can't be 0 and What is the regex for 'Any positive integer, excluding 0' however that didn't work as per my requirements.
I want exact 6 digit numeric number but shouldn't start with 0
I've tried
^[1-9][0-9]{6}*$
^([^0][0-9]){6}$
...
Need fine...