Search : in
By :

Access problem

Last answer on Oct 17, 2008 12:26:47 am BST praveenpr4, on Jul 6, 2008 3:16:18 pm BST 
 Report this message to moderators

Hello,


Hi i would like to access to my database source i am getting each time a message error can someone check whether i have made a mistake somewhere


JAR files has already been added


Construct an access object.
*/
public access ()
{
try
{
Context ctx = new InitialContext();
ds1 = (DataSource)ctx.lookup(dsName1); // Problem here

} catch (Exception e) {
e.printStackTrace();
}
}
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(N amingManager.java:647)
at javax.naming.InitialContext.getDefaultInitCtx(Init ialContext.java:247)
at javax.naming.InitialContext.getURLOrDefaultInitCtx (InitialContext.java:284)
at javax.naming.InitialContext.lookup(InitialContext. java:351)
at access.<init>(access.java:19)
at access.main(access.java:58)
java.lang.NullPointerException
at access.performread(access.java:34

Configuration: Windows XP
Internet Explorer 6.0

Best answers for « Access problem » in :
Random access memory (RAM or PC memory) Show Types of random access memory There are generally two broad categories of random access memory: DRAM memories (Dynamic Random Access Module), which are inexpensive. They are used essentially for the computer's main memory SRAM memories (Static...
WPA - WiFi Protected Access Show Introduction to WPA WPA (WiFi protected Access) WiFi network security solution offered by the WiFi Alliance, in order to fill gaps in WEP. WPA - WiFi Protected Access WPA is a "light" version of the 802.11i protocol, which relies on...
Access the hidden Administrator Account in Windows Vista Show Access the hidden Administrator Account in Windows Vista Why has the Administrator account been disabled in Vista? How to activate the Administrator Account Solution 1: Through User Account Control Solution 2: With Command Prompt Solution...
How to access your BIOS set up ShowHow to access your BIOS set up Depending on your computer model, the way you will access your BIOS set up menu will differ. Here is a list of the most common models used and the access key used for this process. ACER You can make use...
How to Limit internet access to users? ShowHow to Limit internet access to users? Why restrict access to the Internet in the business? Monitor employees or limit access to the Internet? Limiting access to the internet: Defining a code of conduct Modes of regulation of Internet...
PhpMyAdmin - Access denied for user root@localhost ShowPhpMyAdmin - Access denied for user root@localhost To reset the rights of the root user Insert the host and password Beginners may face the problem of accessing MySql by the root user. This issue happens when the root requires you...

1

bitboyx, on Jul 6, 2008 4:57:56 pm BST
  • +2

Try with his command it cound work
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(N amingManager.java:647)
at javax.naming.InitialContext.getDefaultInitCtx(Init ialContext.java:247)
at javax.naming.InitialContext.getURLOrDefaultInitCtx (InitialContext.java:284)
at javax.naming.InitialContext.lookup(InitialContext. java:351)
at access.<init>(access.java:19)
at access.main(access.java:58)
java.lang.NullPointerException
at access.performread(access.java:34

Enable access ( saved )

Reply to bitboyx

2

crazy_devil, on Jul 20, 2008 11:20:28 am BST

Hi praveen,
im straight going to search for an answer and i will soon be back to you with a solution,,,

Reply to crazy_devil

3

 Jon To, on Oct 17, 2008 12:26:47 am BST

You straight searched for an answer but you didn't find one?

What gives?

javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManag­er.java:645)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext­.java:288)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialCo­ntext.java:325)


I'm using hibernate..


<session-factory name="java:comp/hibernate/SessionFactory">

<!-- You need to complete the configuration here. This is just a sample, you should use a connection pool -->
<property name="connection.url">jdbc:oracle:thin:@blah:1521:wah</property>
<property name="connection.username">as</property>
<property name="connection.password">as549</property>
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>

Reply to Jon To