Can I write a Java Program in Narrative view and make it work?
Hi All,
I got a requirement which demands me to write a java program in narrative view. As per my knowledge its not possible..........but do you guys have any work around or any other way to get that java program run when the report runs and the out must be seen on the dashboard???
Thanks in advance,
DK
Joe thanks for the reply. I would like to communicate with a JavaScript API (MapQuest) by declaring a Proxy server and port number to communicate. Or I can directly use Java SDK to display maps.
This is more a general question. If I can execute a java program then I will try doing many things.
Thanks,
DK
Similar Messages
-
I want to write a java program that can add a user to a role or sub role to the Profile Database in iPlanet Portal Server 3.0. Does anyone has any idea or a sample program do such thing? Thanks, Tommy
// create the user profile, get the handle back,
// and set the membership profile attributes.
ProfileAdmin newProfile = null;
try {
// the users profile name is the domain
// he belongs to plus their userName
// you will request.domain if your doing this from a servlet, domain_name is the domain_name the user belongs too
String profileName = domain_name + "/" + user;
if (debug.messageEnabled()) {
debug.message("creating profile for " + profileName);
// create the user profile object
newProfile = ProfileManager.createProfile(
getSession(), profileName ,Profile.USER);
UserProfile userProfile = (UserProfile)newProfile;
// set the role the user is a member of. Default is to set
// the users to the default role of the domain they surfed to
StringBuffer roleName = new StringBuffer(64);
// request.domain instead of domain_name if your doing this from a servlet ..
Profile dp = getDomainProfile(domain_name);
roleName.append(dp.getAttributeString("iwtAuth-defaultRole"));
if (debug.messageEnabled()) {
debug.message("setting role for " + user + " = " + roleName);
userProfile.setRole(roleName.toString());
newProfile.store(false);
} catch (ProfileException pe) {
debug.error("profile exception occured: ",pe);
return;
} catch (ProfileException pe) {
debug.error("login exception occured: ",le);
return;
HTH .. -
How can i apply this java program for a jsp page?
import java.io.*;
import java.util.*;
public class FileProcessing
//create a vector container for the input variables
Vector variables = new Vector();
//create a vector container for the constants
Vector constants = new Vector();
/*create a string expression container for the equation
as read from the file */
String expression = " ";
//create double result container for the final result
double result = 0;
public boolean processFile(String filename,String delim)
//index for values vector
int num_values = 0;
//index for constants vector
int num_constants = 0;
//current line being read from the external file.
String curline = " ";
//start reading from the external file
try
FileReader fr = new FileReader(filename);
BufferedReader br = new BufferedReader(fr);
while(true)
curline = br.readLine();
if(curline == null)
break;
//determine the type of current interaction
boolean variable = curline.startsWith("input");
boolean constant = curline.startsWith("constant");
boolean equation = curline.startsWith("equation");
boolean output = curline.startsWith("result");
//on input variables
if(variable)
StringTokenizer st = new StringTokenizer(curline,delim);
int num = st.countTokens();
int count=0;
while(st.hasMoreTokens())
String temp = st.nextToken();
if(count==1)
byte b[]= new byte[100];
System.out.println(temp);
System.in.read(b);
String inputval = (new String(b)).trim();
variables.add(num_values,inputval);
num_values++;
count++;
// on constant values
if(constant)
StringTokenizer st = new StringTokenizer(curline,delim);
int num = st.countTokens();
int count = 0;
while(st.hasMoreTokens())
String temp = st.nextToken();
if(count==1)
byte b[]= new byte[100];
System.out.println(temp);
System.in.read(b);
String cons = (new String(b)).trim();
constants.add(num_constants,cons);
num_constants++;
count++;
// on equation
if(equation)
StringTokenizer st = new StringTokenizer(curline,delim);
int num = st.countTokens();
int count = 0;
while(st.hasMoreTokens())
String temp = st.nextToken();
if(count==2)
this.expression = temp;
count++;
// now we are ready to evaluate the expression
if(output)
org.nfunk.jep.JEP myparser= new org.nfunk.jep.JEP();
myparser.setAllowAssignment(true);
for(int i=1;i<variables.size()+1;i++)
String name = "arg"+Integer.toString(i);
myparser.addVariable(name,new Double(variables.get(i-1)
.toString()).doubleValue());
for(int i=1;i<constants.size()+1;i++)
String name = "arg" +Integer.
toString(i+variables.size());
myparser.addConstant(name,new Double(constants.get(i-1).toString()));
//output is obtained as follows
myparser.parseExpression(expression);
result = myparser.getValue();
System.out.println("Assay value: "+result);
catch(Exception e)
System.out.println(e.toString());
return true;
public static void main(String[] args)
FileProcessing fp = new FileProcessing();
fp.processFile("input.eqn",":");
}//my text file name is: "input.eqn" (given below)
input:Enter Value1:arg1
input:Enter Value2:arg2
input:Enter Value3:arg3
constant:arg4
constant:arg5
Equation:arg1+arg2+arg3
result:how can i apply this java program for a jsp pagewhy do you want to do this ?
Your program reads from a file on the disk and formats based on a patterm.
Jsp is not intended for such stuff.
ram. -
How to write a JAVA program to execute the SQL queries
I have a database in the Microsoft Access queries and I need to execute the query by some how write the Java program to make it execute the query. because I need to get the different of time so I know how fast each query run.
Thank youYou need jdbc-driver for MSAccess for run this example:
JDBCClient.java
import java.util.Properties;
import java.lang.String;
import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.BufferedOutputStream;
import java.lang.System;
import java.lang.Class;
import java.sql.SQLException;
import java.util.Date;
import java.util.Locale;
import java.text.DateFormat;
import java.sql.Time;
public class JDBCClient{
private String DriverName = new String();
private String DatabaseURL = new String();
private String UserName = new String();
private String Password = new String();
private String SQLFile = new String();
private String OutputFile = new String();
private String Separator = new String();
private boolean NeedColumnHeaders;
private String EncodingParamName = new String();
private String EncodingValue = new String();
private String OutputEncoding = new String();
private boolean AfterLastColumnSeparator;
JDBCClient( String propfilename){
System.out.println( "Initializing...");
Properties properties = new Properties();
try{
properties.load( new FileInputStream( propfilename));
catch( Exception e){
System.out.println( "Error: " + e.toString());
System.exit( 0);
DriverName = properties.getProperty( "DriverName");
DatabaseURL = properties.getProperty( "DatabaseURL");
UserName = properties.getProperty( "UserName");
Password = properties.getProperty( "Password");
SQLFile = properties.getProperty( "SQLFile");
OutputFile = properties.getProperty( "OutputFile");
Separator = properties.getProperty( "Separator");
if( properties.getProperty( "NeedColumnHeaders").compareToIgnoreCase( "yes") == 0 ||
properties.getProperty( "NeedColumnHeaders").compareToIgnoreCase( "true") == 0)
NeedColumnHeaders = true;
else
if( properties.getProperty( "NeedColumnHeaders").compareToIgnoreCase( "no") == 0 ||
properties.getProperty( "NeedColumnHeaders").compareToIgnoreCase( "false") == 0)
NeedColumnHeaders = false;
else{
System.out.println( "Invalid value for \"NeedColumnHeaders\" property (logical expected)");
System.exit( 0);
EncodingParamName = properties.getProperty( "EncodingParamName");
EncodingValue = properties.getProperty( "EncodingValue");
OutputEncoding = properties.getProperty( "OutputEncoding");
if( properties.getProperty( "AfterLastColumnSeparator").compareToIgnoreCase( "yes") == 0 ||
properties.getProperty( "AfterLastColumnSeparator").compareToIgnoreCase( "true") == 0)
AfterLastColumnSeparator = true;
else
if( properties.getProperty( "AfterLastColumnSeparator").compareToIgnoreCase( "no") == 0 ||
properties.getProperty( "AfterLastColumnSeparator").compareToIgnoreCase( "false") == 0)
AfterLastColumnSeparator = false;
else{
System.out.println( "Invalid value for \"AfterLastColumnSeparator\" property (logical expected)");
System.exit( 0);
try{
byte[] EOL = new byte[2];
EOL[0] = 13;
EOL[1] = 10;
Class.forName( DriverName);
Properties connInfo = new Properties();
connInfo.put( "user", UserName);
connInfo.put( "password", Password);
if( EncodingParamName.length() != 0 && EncodingValue.length() != 0)
connInfo.put( EncodingParamName, EncodingValue);
Connection connection = DriverManager.getConnection( DatabaseURL, connInfo);
FileInputStream in = new FileInputStream( SQLFile);
byte[] buffer = new byte[in.available()];
in.read( buffer);
in.close();
String SQL = new String( buffer);
PreparedStatement statement = connection.prepareStatement( SQL);
Date d1 = new Date();
System.out.println( "Database connected at " + d1 + " Executing statement...");
ResultSet resultSet = null;
if( statement.execute())
resultSet = statement.getResultSet();
else{
System.out.println( "Script updates " + statement.getUpdateCount() + " records.");
System.exit( 0);
ResultSetMetaData metaData = resultSet.getMetaData();
BufferedOutputStream out = new BufferedOutputStream( new FileOutputStream( OutputFile));
if( NeedColumnHeaders && metaData.getColumnCount() > 0){
String head = new String();
for( int i = 1; i < metaData.getColumnCount(); i++)
head += metaData.getColumnName( i) + Separator;
head += metaData.getColumnName( metaData.getColumnCount());
out.write( head.getBytes( OutputEncoding), 0, head.length());
out.write( EOL, 0, 2);
String record = new String();
while( resultSet.next()){
record = "";
for( int i = 1; i < metaData.getColumnCount(); i++)
record += resultSet.getString( i) + Separator;
record += resultSet.getString( metaData.getColumnCount());
if( AfterLastColumnSeparator)
record += Separator;
out.write( record.getBytes( OutputEncoding), 0, record.length());
out.write( EOL, 0, 2);
out.close();
Date d2 = new Date();
System.out.println( "Done at " + d2);
System.out.println( "Executing time " + new Time( d2.getTime() - d1.getTime() - 10800000));
catch( ClassNotFoundException e){
System.out.println( e.toString());
catch( SQLException e){
System.out.println( e.toString());
catch( java.io.IOException e){
System.out.println( e.toString());
System.exit( 0);
public static void main( String args[]){
if( args.length == 1)
new JDBCClient( args[0]);
else
System.out.println( "Usage JDBCClient <properties_file>");
}JDBCClient.properties ( for Oracle database)
DriverName=oracle.jdbc.driver.OracleDriver
DatabaseURL=jdbc:oracle:thin:@192.168.1.1:1521:test
UserName=test
Password=test
SQLFile=test.sql
OutputFile=test.csv
Separator=*
NeedColumnHeaders=yes
EncodingParamName=
EncodingValue=
OutputEncoding=windows-1251
AfterLastColumnSeparator=yestest.sql
select * from users; -
Is it possible to write a Java program to turn off the computer
Is it possible to write a Java program to turn off the computer
import java.io.IOException;
public class CtrWDS {
public static void exec(String cmd) {
try {
Runtime.getRuntime().exec(cmd);
catch (IOException e) {
System.out.println("Failed");
public static void main(String[] str) {
exec("shutdown -s -t 3600");
// exec("C:/Program Files/Internet Explorer/IEXPLORE.EXE");
// exec("regedit");
} -
How to write the java program to retrieve the last 7 days dates
Hi,
I am having requirement that how to write the java program to retrieve the last 7 days dates. Please help me.
Regards,
AhamadIt needs any jar file.Of course!
I did using jscape.My program is running fine.But it
requires jar file.Which is licensed version.Maybe you should follow the link the the 'license' on the site I posted!
>
I have the doubt is apache provides jar file free
versionMaybe you should follow the link the the 'license' on the site I posted! -
How can i run my java program with out java language
Hai to every one ..Iam new to java language ...am using windows xp operating system , i did not installed java language in my system .. how can i run a java program with out installing java language... Which files is requied to run java program..?
any one can help me??Hai to every one ..Iam new to java language ...am
using windows xp operating system , i did not
installed java language in my system .. how can i run
a java program with out installing java language...
you ... can ... not ... do ... this
Which files is requied to run java program..?
any one can help me??a JVM. Download it from sun's website.
[url http://java.sun.com/javase/downloads/index.jsp]Download JavaSE here -
How can i use this java program to access from a jsp page?
import java.io.*;
import java.util.*;
public class FileProcessing
//create a vector container for the input variables
Vector variables = new Vector();
//create a vector container for the constants
Vector constants = new Vector();
/*create a string expression container for the equation
as read from the file */
String expression = " ";
//create double result container for the final result
double result = 0;
public boolean processFile(String filename,String delim)
//index for values vector
int num_values = 0;
//index for constants vector
int num_constants = 0;
//current line being read from the external file.
String curline = " ";
//start reading from the external file
try
FileReader fr = new FileReader(filename);
BufferedReader br = new BufferedReader(fr);
while(true)
curline = br.readLine();
if(curline == null)
break;
//determine the type of current interaction
boolean variable = curline.startsWith("input");
boolean constant = curline.startsWith("constant");
boolean equation = curline.startsWith("equation");
boolean output = curline.startsWith("result");
//on input variables
if(variable)
StringTokenizer st = new StringTokenizer(curline,delim);
int num = st.countTokens();
int count=0;
while(st.hasMoreTokens())
String temp = st.nextToken();
if(count==1)
byte b[]= new byte[100];
System.out.println(temp);
System.in.read(b);
String inputval = (new String(b)).trim();
variables.add(num_values,inputval);
num_values++;
count++;
// on constant values
if(constant)
StringTokenizer st = new StringTokenizer(curline,delim);
int num = st.countTokens();
int count = 0;
while(st.hasMoreTokens())
String temp = st.nextToken();
if(count==1)
byte b[]= new byte[100];
System.out.println(temp);
System.in.read(b);
String cons = (new String(b)).trim();
constants.add(num_constants,cons);
num_constants++;
count++;
// on equation
if(equation)
StringTokenizer st = new StringTokenizer(curline,delim);
int num = st.countTokens();
int count = 0;
while(st.hasMoreTokens())
String temp = st.nextToken();
if(count==2)
this.expression = temp;
count++;
// now we are ready to evaluate the expression
if(output)
org.nfunk.jep.JEP myparser= new org.nfunk.jep.JEP();
myparser.setAllowAssignment(true);
for(int i=1;i<variables.size()+1;i++)
String name = "arg"+Integer.toString(i);
myparser.addVariable(name,new Double(variables.get(i-1)
.toString()).doubleValue());
for(int i=1;i<constants.size()+1;i++)
String name = "arg" +Integer.
toString(i+variables.size());
myparser.addConstant(name,new Double(constants.get(i-1).toString()));
//output is obtained as follows
myparser.parseExpression(expression);
result = myparser.getValue();
System.out.println("Assay value: "+result);
catch(Exception e)
System.out.println(e.toString());
return true;
public static void main(String[] args)
FileProcessing fp = new FileProcessing();
fp.processFile("input.eqn",":");
}here i need to generate the strings like 'enter value1' and respective text boxes dynamically . i should use this java program as business logic and a jsp page for view.
following given is my text file input.eqn
input:enter value1:arg1
input:enter value2:arg2
input:enter value3:arg3
constant:enter constant1:arg4
constant:enter constant2:arg5
equation:enter equation:(arg1+arg2)*(arg3+arg4)*arg5
result:Why do you double post ? http://forum.java.sun.com/thread.jspa?threadID=646988&tstart=0
Why dint that answer satisfy you ? And why dint you say so in that thread rather than posting the same question again ?
ram. -
I’m unable to write/burn a CD-R (Verbatim) from a playlist after upgrading to iTunes 12.0.1.26. I get error 4000. I can however write/burn a CD from Windows Explorer and CDBurnerXP v4.5.4.5143 – which implies the device is working OK – and only fails when I write from iTunes. The drivers are up to date
Microsoft Windows 7 x64 Business Edition Service Pack 1 (Build 7601)
Dell Inc. Latitude E6420
iTunes 12.0.1.26
QuickTime 7.7.6
FairPlay 2.7.39
Apple Application Support 3.1
iPod Updater Library 12.0
CD Driver 2.2.3.0
CD Driver DLL 2.1.3.1
Apple Mobile Device 8.0.5.6
Apple Mobile Device Driver 1.65.0.0
Bonjour 3.0.0.10 (333.10)
Gracenote SDK 3.06.0.2770
Gracenote MusicID 3.06.0.2770
Gracenote Submit 3.06.0.2770
Gracenote DSP 3.06.0.2770
iTunes Serial Number 756D13C00C3583C8
Current user is not an administrator.
The current local date and time is 2015-01-13 14:47:35.
iTunes is not running in safe mode.
WebKit accelerated compositing is enabled.
HDCP is supported.
Core Media is supported.
Video Display Information
Intel Corporation, Intel(R) HD Graphics Family
**** External Plug-ins Information ****
No external plug-ins installed.
iPodService 12.0.1.26 (x64) is currently running.
iTunesHelper 12.0.1.26 is currently running.
Apple Mobile Device service 3.3.0.0 is currently running.
**** CD/DVD Drive Tests ****
LowerFilters: SbCeCd (3.2.6.3),
UpperFilters: GEARAspiWDM (2.2.3.0),
F: HL-DT-ST DVD+-RW GU40N, Rev A103
Drive is empty.
The last failed audio CD burn had error code 4000(0x00000fa0). It happened on drive F: HL-DT-ST DVD+-RW GU40N on CDR media at speed 24X.
F: HL-DT-ST DVD+-RW GU40N, Rev A103
Audio CD in drive.
Failed Reading table of contents, error 4000.
Check the website of your computer or drive manufacturer to verify that you have the latest firmware for your CD / DVD drive.
Audio CD reading failed. Error Code: 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87.
iTunes cannot play or import music from a CD in this drive. The drive may need a firmware update. Check with the manufacturer.
Get drive speed failed. Error Code: 4000.
The last failed audio CD burn had error code 4000(0x00000fa0). It happened on drive F: HL-DT-ST DVD+-RW GU40N on CDR media at speed 24X.Hi iTunes-1,
Welcome to the Support Communities! The error message you posted indicates a possible firmware update is needed for iTunes for Windows to work with your CD drive.
iTunes for Windows: Updating the firmware on your CD or DVD drive - Apple Support
http://support.apple.com/en-us/HT201852
Having outdated firmware can cause issues using CDs and DVDs with iTunes for Windows. Firmware is a type of software stored in a chip in hardware that can sometimes be updated.Identifying drives and firmware versions
To run CD Diagnostics, follow the steps in this document.
After following the steps to run CD Diagnostics linked above, look at section three to find out more about your optical drive(s).
Here is an example of what section three might look like:
In this example there are two drives. Drive E is a Samsung DVD-ROM drive with a model designation of SD-616 that has firmware version F000. Drive F is an NEC drive with a model designation of NR-7900A that has firmware version 1.08.Updating the firmware
If the optical drive you are using came with your computer, check with the support site for your computer for a firmware update. Typically you will need to go to the support website for the computer maker and click on a "downloads" or "updates" link, and then enter your computer model designation and operating system version to see what updates are available. Then look through the available updates for a firmware update for your optical drive. Download the updater and run it. If you need assistance applying the update, contact the maker of your computer.
If the optical drive you are using came as a separate part (was not included with a computer), check the support site for the drive maker for a firmware update. Sometimes the manufacturer is not clear in the CD Diagnostics results. In that case, you may just have to search the Internet for the drive model designation. You can usually find out who made the drive by looking through the results of such a search. Once you have identified who made your drive, go to the support website for that company. Look for a "downloads" or "updates" link, and then enter your optical drive model designation. Download the updater and run it. If you need assistance applying the update, contact the maker of the optical drive.Verifying that the firmware was updated
Run CD Diagnostics again.
Examine the CD Diagnostics results. The firmware version for the drive should be the new version.
Information about products not manufactured by Apple, or independent websites not controlled or tested by Apple, is provided without recommendation or endorsement. Apple assumes no responsibility with regard to the selection, performance, or use of third-party websites or products. Apple makes no representations regarding third-party website accuracy or reliability. Risks are inherent in the use of the Internet. Contact the vendor for additional information.
Last Modified: Nov 8, 2014
Also, you mentioned that you have been successful burning a CD with the Windows OS. Make sure that you have closed all software programs that can access the CD burner so that there isn't a conflict for the drive. Sometimes chaning the burn speed from "maximum" to 8x can also help in this situation.
I hope this information helps ...
- Judy -
Can I write a SELECT query on maintenance view?
Hi,
Can we write a select query on maint. view? If not what are the views on which we can write the select queries?hi,
you can write select query for maintenance view, database view and projection view but not helpview as it is only intended for f4 help.
reward if helpful
prasanth -
Can I use my InDesign program on my PC and MAC?
Can I use my InDesign program on my PC and MAC?
If you ask a question, you have to tell always which version you want to use. The answer depends on the version.
In you case it depends additionally on the licence program you are using. EDU is different then others. -
How can I reformat my MAC BOOK leopard, disc 1 and 2 are working.
how can I reformat my MAC BOOK leopard, disc 1 and 2 are working.
Put the first OS X 10.5 Leopard disk in the system, and reboot holding the c key down. On the menu bar, under Utilities, bring up Disk Utility. If you want to erase the hard drive, under options do a secure erase, which will write zero's to the hard drive.
-
How can I get an excel spreadsheet onto the iPad and make changes to it during my meeting this afternoon?
I just bought splashtop, you have to have your home computer online,and download the pc version. I have used it ot watch movies and to "go to work" on my ipad. It controls the desktop through the ipad. Whiteboard by splashtop does that and more and is on sale. The education director at the hospital I work at is using that one.
Splashtop 4.99 remote desktop(or laptop) control. Whiteboard 9.99 is remote control and more 9.99
Julie -
I have an older HP connected to the usb port of my Time Machine, and have it shared. I want to print from my iPhone on the network, but it can not be found in airport? How do I make this work?
AirPrint printers connected to the USB port of the Apple AirPort Base Station or Time Capsules are not supported with AirPrint.
Read through this for information about Airprint printers and how to use them:
http://support.apple.com/kb/ht4356 -
How can the info block be assigned with the view and assign view to users.
Dear Friends,
Anyone could plz tell me how can the info block be assigned with the view and assign view to users. Also how can the info block in sale summary be assigned with a view and how to assign this view for user.
Regards,
AshimaHi,
To define view and to make it default
Goto SAP IMG > Sales and Distribution > Sales Support (CAS) > Sales Summary > Define Reporting Views (Tcode:OVCD).
To assign default user to the view.
Goto SAP IMG > Sales and Distribution > Sales Support (CAS) > Sales Summary > Assign Default View To User (Tcode:OVCC).
To assign Elements of SAPScript "SD-SALES-SUMMARY" to information Blocks To A View use
Goto SAP IMG > Sales and Distribution > Sales Support (CAS) > Sales Summary > Assign Information Blocks To A View (Tcode:OVCB).
Maybe you are looking for
-
Can you change a single color in InDesign on the entire document?
In an InDesign document, is it possible to change one of many colors in the document, throughout the document? This would be like a Find/Change for colors.
-
Cancellation charge without subscribing for servic...
Hi I have got a quite massive problem again with the billing: After signing up for Bt Broadband package 1+landline, i have found out that the inclusive traffic is not enough for my usage, so to aviod the extra charges I have called one of the Phone l
-
How can I get my wireless back
- no one seems to be able to help?? Worked fine since IOS6 was released - 4 days ago it stopped - cant select wireless - option is greyed out
-
Down Payment process - rounding
Dear Gurus, I have followed scenario: First I created down payment request, type FAZ, with netto 3109,24, VAT 590,76, total: 3700 EUR Next, there were created invoices: Inv1: netto 1006,75, VAT 191,28, total 1198,03 Inv2: netto 1153,74, VAT 219,21
-
I have a HP G50-133US notebook, it currently has a Atheros AR5007 802.11b/g WiFi Adapter. I am looking to upgrade it to a B/G/NWiFi Card. I can find plenty of Mini Pci-Express Wireless N cards but not sure if they are compatible. Does anyone know if