darine darine

Ranch Hand
+ Follow
since Mar 08, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by darine darine

hi all
i have a very simple jsp that access a javabean.
my jsp file is in the default directory of tomcat "/weapps/examples/jsp/Box.jsp'
and i have the bean in "/examples/web-inf/classes/Box.java"
my full error is :
" org.apache.jasper.JasperException: Unable to compile C:\jakarta-tomcat-3.3.1\work\DEFAULT\examples\jsp\Box_1.java:50: Class jsp.Box not found.
out.print((new Box().result()));
"
my code are :
==============================
Box.java
public class Box
{
public String result()
{
return "hello world";
}

}
===============================
box.jsp
<%=(new Box().result())%>
22 years ago
JSP
any Resources for EAS framework plz?
22 years ago
thanks for the reply.
yes it does not work with Class.forName()
also when i use the port 1521 i get the following message: " ORA-06401: NETCMN: invalid driver designator "
any idea?
thanks again.
Hi All
I got the following error(the title message)
what is the problem plz?
===============================
import java.sql.*;
import java.util.*;
public class attemptConnection_Without_ClassForName
{
public static void main(String arg[])
{
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
//String sqlStatement="select check_number,posting_date,amount,transaction_number from checkInfo";
String sqlStatement="SELECT * FROM checkInfo where posting_date="+"'"+"28-JAN-2001"+"'";
try
{
//Class.forName("oracle.jdbc.driver.OracleDriver");
DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());

con = DriverManager.getConnection("jdbc racle ci8:@localhost","db2admin","db2admin");
stmt = con.createStatement();
rs = stmt.executeQuery(sqlStatement);
while(rs.next())
{
System.out.println(rs.getInt("check_number") + " "+rs.getDate("posting_date") +" "+rs.getInt("amount")+" "+rs.getInt("transaction_number"));
}
}
/*
catch(ClassNotFoundException e)
{
System.out.println("Couldn't load database driver: " + e.getMessage());
}
*/
catch(SQLException e)
{
System.out.println("SQLException caught: " + e.getMessage());
}
finally
{
try
{
if(con != null) con.close();
}
catch(SQLException ignored){}
}
}
}
Hi
I have installed oracle on my c:\ drive and created database for example of name 'abc'.
now when i go to sqlplus editor and create
a table 'customers' and i do desc command i see all its columns,the question is: is that table 'customers' now in that database 'abc'?
How do i know that?is there a sql statement to show me all tables in that database 'abc'?(sample code plz).
I'm sure i can create many databases too other than 'abc' ...is that right?
To connect to 'abc' is database url should be like the following:
"jdbc racle:thin@localhost:1521:abc"
is that right?
Thanks for your time.
Hi
Hi all
I'm trying to connect from my webapp running on Tomcat to my database which is oracle and it is on my LOCALE MACHINE on drive c:\oracle.
so i need to write the right url to coonect to it.
please any help?
Thanks .
Here is my java class
=========================
import java.sql.*;
import java.util.*;
public class attemptConnection
{
public static void main(String arg[])
{
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
//Here how do i specify the subname to locate my database
con = DriverManager.getConnection("jdbc racle:thin:@147.89.124.140:1527 MS", "scott", "tiger");
stmt = con.createStatement();
}
catch(ClassNotFoundException e)
{
System.out.println("Couldn't load database driver: " + e.getMessage());
}
catch(SQLException e)
{
System.out.println("SQLException caught: " + e.getMessage());
}
finally
{
try
{
if(con != null) con.close();
}
catch(SQLException ignored){}
}
}
}
=========================
22 years ago
Hi
how or where can i find that zip file?
whatthe purpose of it.
Thanks
22 years ago
Hi All
Is there specific configuration for tomcat or classpath to be able to connect to oracle from webapp running on Tomcat?
Would you please provide me with steps that show how to perform that?
Thanks for your time.
23 years ago
Hi All
Is there specific configuration for tomcat or classpath to be able to connect to oracle from webapp running on Tomcat?
Would you please provide me with steps that show how to perform that?
Thanks for your time.
Hi All
Please tell me how to deploy jsp and servlet with websphre 4.0.2?
refer me plz for documentaion regarding that.
Thanks alot for your time.
23 years ago
Thank you very much.
23 years ago
Thank you agai.
fianly it worked,but i do not see any config.xml file there?i do have that file with the default
domain(mydomain)but i do not have it with the new domain,also even i changed the port to 7011,still my server responding on 7001 and not 7011.
thanks for the help again.
23 years ago
thanks for the reply.
yes i did,but do i have to edit anything with them?
I'm still having the same problem.
thanks again
23 years ago
Hi all
I'm trying to create new domain with weblogic other than the default(mydomain),the problem is when i start weblogic as soon as gets to the point where to load the configuration file it exits completly.
When i check "all domain configuration"in the console i see that the new damain is active=false
is not as mydomain active=true.
please any help with that,here are my scripts to start weblogic:
startWebLogic.cmd
==================================
@echo off
@rem This script can be used to start WebLogic Server. This script ensures that
@rem the server is started using the config.xml file found in this directory and
@rem that the CLASSPATH is set correctly. This script contains the following variables:
@rem
@rem JAVA_HOME - Determines the version of Java used to start
@rem WebLogic Server. This variable must point to the
@rem root directory of a JDK installation and will be set
@rem for you by the WebLogic Server installer. Note that
@rem this script uses the hotspot VM to run WebLogic Server.
@rem If you choose to use a JDK other than the one
@rem included in the disribution, make sure that the JDK
@rem includes the hotspot VM. See the WebLogic platform support
@rem page (http://e-docs.bea.com/wls/platforms/index.html)
@rem for an up-to-date list of supported JVMs on Windows NT.
@rem
@rem When setting these variables below, please use short file names (8.3).
@rem To display short (MS-DOS) filenames, use "dir /x". File names with
@rem spaces will break this script.
@rem
@rem jDriver for Oracle users: This script assumes that native libraries
@rem required for jDriver for Oracle have been installed in the proper
@rem location and that your system PATH variable has been set appropriately.
@rem For additional information, refer to Installing and Setting up WebLogic
@rem Server (http://e-docs.bea.com/wls/docs61/install/index.html).
SETLOCAL
cd ..\..
@rem Set user-defined variables.
set JAVA_HOME=C:\bea\jdk131
@rem Check that script is being run from the appropriate directory
if not exist lib\weblogic.jar goto wrongplace
goto checkJDK

:wrongplace
echo startWebLogic.cmd must be run from the config\test directory. 1>&2
goto finish
:checkJDK
if exist "%JAVA_HOME%/bin/javac.exe" goto runWebLogic
echo.
echo Javac wasn't found in directory %JAVA_HOME%/bin.
echo Please edit the startWebLogic.cmd script so that the JAVA_HOME
echo variable points to the root directory of your JDK installation.
goto finish
:runWebLogic
echo on
set PATH=.\bin;%PATH%
set CLASSPATH=.;.\lib\weblogic_sp.jar;.\lib\weblogic.jar
echo off
echo.
echo ***************************************************
echo * To start WebLogic Server, use the password *
echo * assigned to the system user. The system *
echo * username and password must also be used to *
echo * access the WebLogic Server console from a web *
echo * browser. *
echo ***************************************************
@rem Set WLS_PW equal to your system password for no password prompt server startup.
set WLS_PW=weblogic
@rem Set Production Mode. When set to true, the server starts up in production mode. When
@rem set to false, the server starts up in development mode. The default is false.
set STARTMODE=false
echo on
"%JAVA_HOME%\bin\java" -hotspot -ms64m -mx64m -classpath "%CLASSPATH%" -Dweblogic.Domain=test -Dweblogic.Name=myserver "-Dbea.home=C:\bea" -Dweblogic.management.password=%WLS_PW% -Dweblogic.ProductionModeEnabled=%STARTMODE% "-Djava.security.policy==C:\bea\wlserver6.1/lib/weblogic.policy" -Dweblogic.management.discover=false weblogic.Server
goto finish

:finish
cd config\test
ENDLOCAL
=================================
startManagedWebLogic.cmd
===============================
@echo off
@rem This script can be used to start Managed WebLogic Server. This script ensures that the CLASSPATH is set correctly. This script contains the following variables:
@rem
@rem JAVA_HOME - Determines the version of Java used to start
@rem WebLogic Server. This variable must point to the
@rem root directory of a JDK or JRE installation. See
@rem the WebLogic platform support page
@rem (http://e-docs.bea.com/wls/platforms/index.html)
@rem for an up-to-date list of supported JVMs on Windows NT.
@rem
@rem When setting these variables below, please use short file names (8.3).
@rem To display short (MS-DOS) filenames, use "dir /x". File names with
@rem spaces will break this script.
@rem
@rem jDriver for Oracle users: This script assumes that native libraries
@rem required for jDriver for Oracle have been installed in the proper
@rem location and that your system PATH variable has been set appropriately.
@rem For additional information, refer to Installing and Setting up WebLogic
@rem Server (documentation/install/index.html in your local documentation set
@rem or on the Internet at http://e-docs.bea.com/wls/docs61/install/index.html).
SETLOCAL
cd ..\..
@rem Set user-defined variables.
set JAVA_HOME=C:\bea\jdk131
@rem Check that script is being run from the appropriate directory
if not exist lib\weblogic.jar goto wrongplace
goto checkJDK
:wrongplace
echo startManagedWebLogic.cmd must be run from the config\test directory. 1>&2
goto finish
:checkJDK
if exist "%JAVA_HOME%/bin/javac.exe" goto runWebLogic
echo.
echo Javac wasn't found in directory %JAVA_HOME%/bin.
echo Please edit the startManagedWebLogic.cmd script so that the JAVA_HOME
echo variable points to the root directory of your JDK installation.
goto finish
@rem Set SERVER_NAME and ADMIN_URL, they must by specified before starting
@rem a managed server, the detail information can be found on the Internet at
@rem http://e-docs.bea.com/wls/docs61/install/index.html.
:runWebLogic
if "%1" == "" goto checkEnvVars
if "%2" == "" goto usage
set SERVER_NAME="%1"
set ADMIN_URL="%2"
goto startWebLogic
:checkEnvVars
if "%SERVER_NAME%" == "" goto usage
if "%ADMIN_URL%" == "" goto usage
set SERVER_NAME="%SERVER_NAME%"
set ADMIN_URL="%ADMIN_URL%"
goto startWebLogic
:usage
echo Need to set SERVER_NAME and ADMIN_URL environment variables or specify
echo them in command line:
echo Usage: startManagedWebLogic [SERVER_NAME] [ADMIN_URL]
echo for example:
echo startManagedWebLogic managedserver1 http://localhost:7001
goto finish
:startWebLogic
echo on
set PATH=.\bin;%PATH%
set CLASSPATH=.;.\lib\weblogic_sp.jar;.\lib\weblogic.jar
echo off
echo.
echo ***************************************************
echo * To start WebLogic Server, use the password *
echo * assigned to the system user. The system *
echo * username and password must also be used to *
echo * access the WebLogic Server console from a web *
echo * browser. *
echo ***************************************************
@rem Set WLS_PW equal to your system password for no password prompt server startup.
set WLS_PW=
@rem Set Production Mode. When set to true, the server starts up in production mode. When
@rem set to false, the server starts up in development mode. The default is false.
set STARTMODE=true
echo on
"%JAVA_HOME%\bin\java" -hotspot -ms64m -mx64m -classpath "%CLASSPATH%" -Dweblogic.Domain=test -Dbea.home="C:\bea" -Dweblogic.management.password=%WLS_PW% -Dweblogic.ProductionModeEnabled=%STARTMODE% -Dweblogic.Name=%SERVER_NAME% -Dweblogic.management.server=%ADMIN_URL% "-Djava.security.policy==C:\bea\wlserver6.1/lib/weblogic.policy" weblogic.Server
goto finish

:finish
cd config\test
ENDLOCAL
23 years ago
Hello All
after i got:
C:\csc193\examples\network>java -Djava..rmi.server.codebase=file:/..\..\ -D
java.security.policy=RMISecurity.policy examples.network.StudentEnrollment
student objects bound .
what does that(the exception) mean?how can i fix that?
do i need to set up anything?
thanks for your time.
here is the full exception:
===========================
C:\csc193\examples\network>java -Djava.security.policy=RMISecurity.policy e
xamples.network.StudentClient
java.rmi.NotBoundException: Student1001
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(U
nknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Unknown Source)
at examples.network.StudentClient.main(StudentClient.java:17)
===========================
here are my app's files:
=============================
grant
{
permission java.net.SocketPermission "*:1024-65535",
"connect,accept";

};
============================
package examples.network;
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface Student extends Remote
{
public int getID() throws RemoteException;
public void setName(String name) throws RemoteException;
public String getName() throws RemoteException;
public int getCredits() throws RemoteException;
public int addCredits(int credits) throws RemoteException;

}
=======================================
package examples.network;
import java.rmi.Naming;
import java.rmi.RMISecurityManager;
public class StudentClient
{
private static final String HOST_NAME="localhost";
public static void main(String s[])
{
if(System.getSecurityManager()==null)
{
System.setSecurityManager(new RMISecurityManager());
}

try
{
Student s1001=(Student) Naming.lookup("//"+HOST_NAME+"/Student1001");
Student s1005=(Student) Naming.lookup("//"+HOST_NAME+"/Student1005");
System.out.println(s1001.getName());
System.out.println(s1005.getName());
System.out.println(s1001.getCredits());
s1001.addCredits(3);
s1001.setName("Elaine Goldman");
System.out.println(s1001.getName());
System.out.println(s1001.getCredits());
}
catch(Exception x)
{
x.printStackTrace();
}
}

}
===============================
package examples.network;
import java.rmi.Naming;
import java.rmi.RMISecurityManager;
public class StudentEnrollment
{
public static void main(String s[])
{
if(System.getSecurityManager()==null)
{
System.setSecurityManager(new RMISecurityManager());
}

try
{
StudentImpl[] students=
{
new StudentImpl( 1001,"Matt1 "),
new StudentImpl( 1002,"Matt2 "),
new StudentImpl( 1003,"Matt3 "),
new StudentImpl( 1004,"Matt4 "),
new StudentImpl( 1005,"Matt5 ")
};
for(int i=0;i<students.length;i++)
{
int id =students[i].getID();
Naming.rebind("student"+id,students[i]);
}
System.out.println("student objects bound .");
}
catch(Exception x)
{
x.printStackTrace();
}
}

}
==================================
package examples.network;
import java.rmi.server.UnicastRemoteObject;
import java.rmi.RemoteException;
public class StudentImpl extends UnicastRemoteObject
implements Student
{
private int ID;
private String name;
private int credits=0;
public StudentImpl(int ID,String name)throws RemoteException
{
this.ID=ID;
this.name=name;
}
public int getID() throws RemoteException
{
return ID;
}
public void setName(String name) throws RemoteException
{
this.name=name;
}
public String getName() throws RemoteException
{
return name;
}
public int getCredits() throws RemoteException
{
return credits;
}
public int addCredits(int credits) throws RemoteException
{
return (this.credits +=credits);
}

}
============================================
23 years ago