• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

wht Jboss settings need to be done to get DB connection using JNDI

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hii All

I am totally new in doing the Configuration of Jboss.
I am using PostGreSQL 8.1 Databse
JBoss-4.2.0 is my Application Server.

I am not able to get connection using JNDI naming convention.
Can anybody pls help me .

Thanks in Advance.
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello "Shiney Baby"

Welcome to JavaRanch

We are glad to have you here. We have a naming policy at JavaRanch. Your displayed name must consist of a first name (or an initial), a space, and a family name (in that order) and not be obviously fictitious. Please take a moment to change it, which you can do right here.
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you setup a datasource for PostgreSQL as mentioned at SetUpAPostgreSQLDatasource. How are you accessing the datasource? Can you post the code? Also, do you see any exceptions when you try to access the datasource? If so, please post the exception stacktrace.
 
Shiney Thomas
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Jaikiran Pai:
Have you setup a datasource for PostgreSQL as mentioned at SetUpAPostgreSQLDatasource. How are you accessing the datasource? Can you post the code? Also, do you see any exceptions when you try to access the datasource? If so, please post the exception stacktrace.



Hii!

While taking connection , it is not throwing any error.

the contents of Postgre-ds.xml are............

<?xml version="1.0" encoding="UTF-8"?>

<!-- ===================================================================== -->
<!-- -->
<!-- JBoss Server Configuration -->
<!-- -->
<!-- ===================================================================== -->

<!-- $Id: postgres-ds.xml 41016 2006-02-07 14:23:00Z acoliver $ -->
<!-- ==================================================================== -->
<!-- Datasource config for Postgres -->
<!-- ==================================================================== -->


<datasources>
<local-tx-datasource>
<jndi-name>PostgresDS</jndi-name>
<connection-url>jdbc ostgresql://192....:5432/9thJuly2007</connection-url>;
<driver-class>org.postgresql.Driver</driver-class>
<user-name>xx</user-name>
<password>yy</password>
<!-- sql to call when connection is created. Can be anything, select 1 is valid for PostgreSQL
<new-connection-sql>select 1</new-connection-sql>
-->

<!-- sql to call on an existing pooled connection when it is obtained from pool. Can be anything, select 1 is valid for PostgreSQL
<check-valid-connection-sql>select 1</check-valid-connection-sql>
-->

<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
<metadata>
<type-mapping>PostgreSQL 8.1</type-mapping>
</metadata>
</local-tx-datasource>

</datasources>
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please don't ignore the request to correct your display name. Your account will be closed soon.

Dave
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for changing your display name.


While taking connection , it is not throwing any error.
I am not able to get connection using JNDI naming convention.



So can you post the code where you getting the connection using the JNDI name? Also if there is no exception thrown, what behaviour are you seeing? I mean what does not able to get connection mean? And what is the JNDI name you are using for getting the connection. Also, from where are you trying to get the connection? Is it from a standalone java program or is it from a jsp or servlet?
 
No matter. Try again. Fail again. Fail better. This time, do it with this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!