Riaz Mohamed

Greenhorn
+ Follow
since May 31, 2002
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 Riaz Mohamed

Hi
Well what do u mean by core java.. If u need to throw the report back to the browser u could use a servlet and embedd html tags on it.
If u do need to write a file on to u'r hard disk use i/o for the same. let me know if u do need a program to srite a html file.
regards
riaz
17 years ago
hi guys try this,
public static java.sql.Date getCurrentDate()
{
//long currentTime=System.currentTimeMillis();
//return new java.sql.Date(currentTime);
Calendar mobjCalendar = Calendar.getInstance();
java.sql.Date mdtSQLDate = new java.sql.Date(mobjCalendar.getTime().getTime());
return mdtSQLDate;
}
17 years ago
hi
There is actually no need to go in for ANT for this. java has a javadoc command somethin like javac and java. You could just use this command instead of using ant
regards
riaz
17 years ago
hi all
Thanks for poting your reply'w . I just happened to write a simple program and used reflectiion to get what i needed. I'm pasting below what i had written an could be of a lotta use.
import java.io.*;
import java.lang.reflect.*;
public class expression
{
public static void main (String []arg)
{
//String strin="((45 > 21) && (45 < 61)) || ((47 > 25) && (47< 51))";
//Assuming u have a string as follows
String strin="((45 < 21) && (45 < 61)) || ((47 > 25) && (47< 51))";
//Creates a temporary file called Samp and assigns the string value toa boolean
String fileContent="package .net; \n"
+"public class Samp {\n "
+" boolean X = "+strin+";\n "
+" public boolean getValue() "
+" { \n"
+" return X;\n"
+" }\n"
+" }";
String args[] = { "-classpath", ".",
"-sourcepath", ".",
"-d", ".",
//"-verbose",
"Samp.java"};
BufferedWriter wr = null;
try
{
// write the file to the disc
wr = new BufferedWriter(new FileWriter("Samp.java"));
wr.write(fileContent);
wr.close();
//Code for compilation
boolean x = new sun.tools.javac.Main(System.out,"javac").compile(args);
//Use reflection to get the class that has been generated
Class c = Class.forName("Samp");
//Get an object of the class
Object o = c.newInstance();
//Invoke a method on the object
Method m = c.getDeclaredMethod("getValue", null);
String tsReturn=m.invoke(o,null).toString();
System.out.println(m.invoke(o,null));
System.out.println(tsReturn);
boolean returnBool=Boolean.valueOf(tsReturn).booleanValue();
System.out.println(returnBool);

}
catch(Exception e)
{
}
}
}
17 years ago
Hi all,
I am looking out for something very urgently
The problem
I have a string "((45 > 21)&& (45 < 61)) || ((47 > 25) && (47< 51))"
this is dinamically created. I have gotta evaluate this string to return a boolean value of true or false as per the condition.
The problem is since it is a string i am not able to get it into an of condition but if i have the same expression as a boolean for eg boolean tbExp=((45 > 21)&& (45 < 61)) || ((47 > 25) && (47< 51));
then the compiler automatically assigns a value of true or false to tbExp as per the expression. Is there any way that i could convert a string object to a boolean. Otherwise how do i go about the same.
regards
riaz
17 years ago
Hi
Could u try this instead
Class.forName("COM.ibm.db2.jdbc.net.DB2Driver");
url=jdbc b2://"; + dbHost + "/" + dbName
If you do face more problems lemme know will send u the complete code
regards
riaz
could you please lemme know what is hte version an the fixpack u using.
hi
Well u could create a database in mysql when u start the installation of your application .All you have to do is execute a jdbc query to create a database (create database database name We have done this before. And you could always. You could start mysql by starting the process. Use runtime process in java , would help. Lemme know if you do want the code for the same
regards
riaz
previous
public boolean previous()
throws SQLException <../../java/sql/SQLException.html>
Moves the cursor to the previous row in this ResultSet object.
Returns:
true if the cursor is on a valid row; false if it is off the result set
Throws:
SQLException <../../java/sql/SQLException.html> - if a database access error occurs or the result set type is TYPE_FORWARD_ONLY
Since:
1.2

does this help
regardsr
riaz
hi all,
I guess jdbc would be real fast and if you do have a situation where u query or insert into multiple tables jdbc i guess would be the best to use . As said earlier you could use jdbc with jta for transaction management. Well the major performance issue would be ideally if u had a query of more than one table then u gotto have many ejb's each for a table in the database ,and the more ejb's u have the lookup from your session bean would be more costly.Sope i would suggest you go for jdbc though ou would not get the sturdiness , maintenance and security you get with EJB
regards
riaz
hi
adding to sethu's reply , u could try even pramathi , they have got both the ide as well the server package, the ide of pramathi would create the deployment descriptors for u as well, other than that it is ejb2.0 complient.. u could deploy the ejb's on the pramathi applicvation server as well. Another advantage would be you could port the application to both weblogic as well as websphere
try www.pramathi.com
regards
riaz
hi
try this on your config file
<JDBCDataSource JNDIName="myDataSource" Name="myDataSource"
PoolName="myDataSource" Targets="myserver"/>
This is for the pool cos the datasource would refer to a jdbc connectoin pool
<JDBCConnectionPool CapacityIncrement="2"
DriverName="weblogic.jdbc.informix4.Driver" InitialCapacity="5"
MaxCapacity="25" Name="myDataSource"
Properties="user=;db=;port=;password=;server="
Targets="myserver" URL="jdbc:weblogic:informix4 ool@server ort"/>
regards
riaz
hi william
We do work with informix and we have got it working successfully . The version of informix we are using is 9.21 , well but the application server we use is weblogic6.1, we are able to create dataasources, realms etc .
please let me know if u do need the details .. my mail id being devils_r_naughty@yahoo.com
regards
riaz
hi ian
Welcome to the J2EE club. It would be great if you could kindly let us know whether u r talking bout setting up a server for developement purposes or do you want to set up some appplication servers to run an application etc ..
we could help you out if you could be a bit more clear
thanks and regards
riaz
try this
or i could send u some code which i had written u could understand it ..well one more thing do u want this for internationalization
http://java.sun.com/webservices/docs/ea1/tutorial/doc/WebApp8.html
regards
riaz