Weblogic : Creating JDBC Datasources
Dear All,
I'm newbie in weblogic . Please anyone guide me to create JDBC datasources for POSTGRESQL in steps.I've googled a lot for this. but i couldn't make it out. I'm using weblogic latest release 11g.Thanks in advance.
Steps to configure a datasource can be found here: http://download.oracle.com/docs/cd/E21764_01/apirefs.1111/e13952/taskhelp/jdbc/jdbc_datasources/CreateDataSources.html
As your Database Type, you can select postgresql from the drop down list.
You also have to add the jar file that contains the postgresql drivers to the classpath.
You add this to the <middleware-home>/user_projects/domains/<domain-name>/lib directory (after this you have to restart your server)
Similar Messages
-
Creating JDBC datasource in Weblogic 10
I have a requirement to create JDBC datasource at runtime if necessary. Weblogic provides JMX services for creating datasource however this required credential of Admin Server (node manager).
As my application is deployed in one of the managed node and as per the security policies admin credential will not be available..
so how can I create a datasource at runtime on fly applicable only for my node.. this should not require admin credentials?
Edited by: user5798282 on Apr 28, 2010 12:50 PMThanks for your reply. However both seems to be way of creating datasource in weblogic 8 . The first one is deprecated in Weblogic 10, the 2nd one requires weblogic admin username and password
-
Error while trying to use Ant and creating Jdbc Datasource
I was following the documentation to auto-create my datasource in my weblogic server. I get an error while it is trying to link the datasource to the server. Does anybody have any ideas,it is almost like the query to get the server isn't working.
Here is my ant task:
<target name="setupJdbcDatasource">
<wlconfig url="t3://localhost:7001" username="weblogic" password="weblogic">
<query domain="MyDomain" type="Server" name="AdminServer" property="adminserver"/>
<create type="JDBCConnectionPool" name="TestDatasource" property="DatasourceTest">
<set attribute="CapacityIncrement" value="1"/>
<set attribute="DriverName" value="weblogic.jdbcx.oracle.OracleDataSource"/>
<set attribute="InitialCapacity" value="1"/>
<set attribute="MaxCapacity" value="10"/>
<set attribute="Password" value="cmuser"/>
<set attribute="Properties" value="user=cmuser SID=ORCH serverName=10.13.5.144 portNumber=1521"/>
<set attribute="RefreshMinutes" value="0"/>
<set attribute="ShrinkPeriodMinutes" value="15"/>
<set attribute="ShrinkingEnabled" value="true"/>
<set attribute="TestConnectionsOnRelease" value="false"/>
<set attribute="TestConnectionsOnReserve" value="false"/>
<set attribute="URL" value="jdbc:bea:oracle://10.13.5.144:1521"/>
<set attribute="Targets" value="${adminserver}"/>
</create>
</wlconfig>
</target>
My Domain is MyDomain, and server is AdminServer. The error I get is:
[wlconfig] weblogic.management.DistributedManagementException : Distributed Management [1 exceptions]
BUILD FAILED
X:\ibutt_PCView\src\CM\build.xml:285: Error invoking MBean
command: javax.management.MBeanException
And in my server log:
jdbcDataSourceBean=[MBeanServerInvocationHandler]com.bea:Name=CP-ConfigManagemen
tTest,Type=weblogic.j2ee.descriptor.wl.JDBCDataSourceBean,Parent=[MyDomain]/JDBC
SystemResources[CP-ConfigManagementTest],Path=JDBCResource
<May 21, 2006 3:50:57 PM EDT> <Warning> <JDBC> <BEA-001129> <Received exception
while creating connection for pool "ConfigManagementTest": [BEA][Oracle JDBC Dri
ver]Missing connection information: no serverName specified.>
<May 21, 2006 3:50:58 PM EDT> <Error> <Deployer> <BEA-149265> <Failure occured i
n the execution of deployment request with ID '1148241051441' for task 'weblogic
.deploy.configChangeTask.2'. Error is: 'weblogic.application.ModuleException: '
weblogic.application.ModuleException:Hi. This seems like an XML parsing problem.
Could you please try changing the driver
properties from:
<set attribute="Properties" value="user=cmuser SID=ORCH serverName=10.13.5.144 portNumber=1521"/>
to:
<set attribute="Properties" value="user=cmuser SID=ORCH"/>
The server and port are already in the URL
thanks,
Joe -
Error in creating JDBC datasource
I would like to create a new JDBC datasource using WLST script.
There are 2 problems with it:
1. Running the script an error message will be displayed:
Creating JDBCSystemResource with name DBonHelium5
JDBCSystemResource with name 'DBonHelium5' has been created successfully.
Problem invoking WLST - Traceback (innermost last):
File "/opt/wls9/jdbc_data_source_creation.py", line 30, in ?
AttributeError: addJndiName
I don’t understand why it is wrong and how could I fix the bug...
2. After running the script I looked at the current state on the console.
The datasource has been created but the target isn’t set.
Could you help me what’s wrong?
Thanks in advice!
Zsigmond
The script:
connect("xxx","xxx")
edit()
startEdit()
# Change these names as necessary
dsname="DBonHelium5"
cd("Servers/AdminServer")
#target=getMBean("Servers/AdminServer")
target=cmo
cd("../..")
# start creation
print 'Creating JDBCSystemResource with name '+dsname
jdbcSR = create(dsname,"JDBCSystemResource")
theJDBCResource = jdbcSR.getJDBCResource()
theJDBCResource.setName("DBonHelium5")
connectionPoolParams = theJDBCResource.getJDBCConnectionPoolParams()
connectionPoolParams.setConnectionReserveTimeoutSeconds(25)
connectionPoolParams.setMaxCapacity(100)
connectionPoolParams.setTestTableName("SYSTABLES")
dsParams = theJDBCResource.getJDBCDataSourceParams()
<b>dsParams.addJndiName("DBonHelium5")</b>
driverParams = theJDBCResource.getJDBCDriverParams()
driverParams.setUrl("jdbc:bea:oracle://helium.lsy.bud.dlh.de:1521")
driverParams.setDriverName("weblogic.jdbcx.oracle.OracleDataSource")
driverParams.setPassword("LSY")
driverProperties = driverParams.getProperties()
proper = driverProperties.createProperty("user")
proper.setValue("LSY")
proper1 = driverProperties.createProperty("DatabaseName")
proper1.setValue("dbc:bea:oracle://helium.lsy.bud.dlh.de:1521")
<b>jdbcSR.addTarget(target)</b>
try:
save()
activate(block="true")
print "script returns SUCCESS"
except:
print "Error while trying to save and/or activate!!!"
dumpStack()
disconnect()
exit()Hi Manfed,
I've got exactly the same problem mit j2sdkee 1.3.1. Have yor resolved the problem in the meantime?
If so, please post the solution. Thanks.
Helmut -
Creating JDBC Datasource without Console
I am new to WebLogic. Currently, getting up to speed with WebLogic server 10.3. I can create a JDBC pool from the console. Is there a way to create the JDBC pool without using the console? Also, is there a way that we can create the JDBC resource during the deployment of the application via WAR file?
Thanks in advance.please see: Re: Creating JDBC Resource without Console
-
JDBC Datasource creation via ANT doesn't expose the JNDI name
I'm using the wlconfig ANT task to create a Datasource (& JDBC connectionpool) on the weblogic server. The datasource is created fine, and I can test it using the console.
The problem is that the provided JNDI name isn't exposed in the JNDI tree. This seems to be related to the fact that the following element is generated in the config/jdbc/CP-PoolName-2164-jdbc.xml
<jdbc-data-source>
<name>PoolName</name>
<internal-properties>
*<property>*
*<name>LegacyType</name>*
*<value>1</value>*
*</property>*
When removing the LegacyType 1 property from the JDBC config xml, the JNDI name is exposed fine.
I've used the instructions located at [http://edocs.bea.com/wls/docs100/programming/ant_tasks.html] where an example of a JDBCConnectionPool creation is provided.
The 10.3 documentation doesn't include the example anymore, but I'm having the problem both on BEA Weblogic 10.0 and Oracle Weblogic 10.3
<wlconfig url="t3://localhost:7001" username="weblogic" password="weblogic">
bq. <query domain="base_domain" type="Server" name="AdminServer" property="adminserver"/>
bq. <create type="JDBCConnectionPool" name="MediumSecureOnlineNode1Pool" property="customPool1">
bq. bq. <set attribute="CapacityIncrement" value="1"/> \\ <set attribute="DriverName" value="oracle.jdbc.OracleDriver"/> \\ <set attribute="InitialCapacity" value="1"/> \\ <set attribute="MaxCapacity" value="10"/> \\ <set attribute="Password" value="pass"/> \\ <set attribute="Properties" value="user=username"/> \\ <set attribute="RefreshMinutes" value="0"/> \\ <set attribute="ShrinkPeriodMinutes" value="15"/> \\ <set attribute="ShrinkingEnabled" value="true"/> \\ <set attribute="TestConnectionsOnCreate" value="true"/> \\ <set attribute="TestConnectionsOnRelease" value="true"/> \\ <set attribute="TestConnectionsOnReserve" value="true"/> \\ <set attribute="TestTableName" value="SQL SELECT 1 FROM DUAL"/> \\ <set attribute="URL" value="jdbc:oracle:thin:@localhost:1521"/> \\ <set attribute="Targets" value="${adminserver}"/>
</create>
As we would like to automate the process of configuring our weblogic instances using ANT, is there a way to create JDBC datasources that don't have the LegacyType 1 element included in the config ?Curious if you were ever able to find a resolution to this issue?
I am facing the same thing now with our Ant scripts and WL10.3 connection pools/datasources.
I would like to either specify a different LegacyType or suppress it altogether. Any help would be appreciated.
Many thanks,
Steve -
JDBC Datasource problem in AM configrations
Hi,jhon
can u tell me the how to create the jdbcdatasource in WLS how we have to give the jndi name and i have changed in AM configration of JDBC Datasource but its not matching with jdbc datasource present in WLS can anyone tell me with the example how to create jdbc datasource
May 7, 2009 8:01:38 PM oracle.adf.share.security.providers.jps.CSFCredentialStor
e fetchCredential
WARNING: Unable to locate the credential for key FOD in C:\Oracle\Middleware\use
r_projects\domains\SFA\config\oracle.
May 7, 2009 8:01:38 PM oracle.adf.share.jndi.ReferenceStoreHelper throwPartialRe
sultException
WARNING: Incomplete connection information
May 7, 2009 8:01:38 PM oracle.adf.share.security.providers.jps.CSFCredentialStor
e fetchCredential
WARNING: Unable to locate the credential for key fod1 in C:\Oracle\Middleware\us
er_projects\domains\SFA\config\oracle.
May 7, 2009 8:01:38 PM oracle.adf.share.jndi.ReferenceStoreHelper throwPartialRe
sultException
WARNING: Incomplete connection information
May 7, 2009 8:01:46 PM com.sun.faces.lifecycle.Phase doPhase
SEVERE: jsf.lifecycle.phase.exception
<May 7, 2009 8:01:46 PM GMT+05:30> <Error> <HTTP> <BEA-101017> <[weblogic.servle
t.internal.WebAppServletContext@1d164ae - appName: 'application1', name: 'adfm',
context-path: '/adfm', spec-version: '2.5', request: weblogic.servlet.internal.
ServletRequestImpl@9a1336[
GET /adfm/faces/br-o.jspx?_adf.ctrl-state=41665048_3 HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shock
wave-flash, application/x-ms-application, application/x-ms-xbap, application/vnd
.ms-xpsdocument, application/xaml+xml, */*
Accept-Language: en-us
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.5072
7; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Connection: Keep-Alive
Cookie: oracle.uix=0^^GMT+5:30; JSESSIONID=QcJvKCwChv6V6Rx61T6hL1V7bvcbjGRtX9SCP
2ydnrTLKtTW05c6!-595734161
]] Root cause of ServletException.
oracle.jbo.DMLException: JBO-26061: Error while opening JDBC connection.
at oracle.jbo.server.ConnectionPool.createConnection(ConnectionPool.java
:253)
at oracle.jbo.server.ConnectionPool.instantiateResource(ConnectionPool.j
ava:168)
at oracle.jbo.pool.ResourcePool.createResource(ResourcePool.java:546)
at oracle.jbo.pool.ResourcePool.useResource(ResourcePool.java:327)
at oracle.jbo.server.ConnectionPool.getConnectionInternal(ConnectionPool
.java:104)
Truncated. see log file for complete stacktrace
java.sql.SQLException: ORA-01005: null password given; logon denied
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.ja
va:70)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:1
16)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
:177)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:406)
Truncated. see log file for complete stacktrace
>http://blogs.oracle.com/shay/2008/11/common_pitfalls_when_deploying.html
-
Whats is JDBC DataSource Factory ??
What is the biggest different between from JDBC DataSource and JDBC DataSource
Factory ??
It says that JDBC DataSource Factory enables the EJB to map a resource factory
reference in the EJB deployment descriptor. But can't I do the same thing to JDBC
DataSource ????Did you target your datasource when you created it?
Did you look at the server output log to if that the connection pool and
data source had any errors in deploying to the target?
<Muthukumaran Shanmuga> wrote in message
news:[email protected]..
I defined a datasource for sybase named let us say "SDS".
I get error with my test program as follows.
javax.naming.NameNotFoundException: Unable to resolve 'SDS'. Resolved '';
remaining name 'SDS'
How do I troubleshoot this error?
Is there a way to list names of JNDI datasources for a WLS instance?
I am sure I created jdbc datasource "SDS" under base_domain via console
and tested the connection
My current test program code is as follows.
Properties prop = new Properties();
prop.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
prop.put(Context.PROVIDER_URL,
"t3://localhost:7001");
System.out.println("DEBUG: create initialConext:start");
InitialContext ic = new InitialContext(prop);
System.out.println("DEBUG: create initialConext:end");
DataSource ds =null;
System.out.println("DEBUG: looking up datasource:start");
ds = (DataSource)ic.lookup("SDS");
System.out.println("DEBUG: looking up datasource:end");
System.out.println("DEBUG: get Connection:start");
Connection c = ds.getConnection();
System.out.println("DEBUG: get Connection:end");
}catch( Exception ex){
System.out.println(ex.toString());
Thanks -
How to undeploy JNDI JDBC datasources?
We have created JDBC DataSource in production server, and deleted as we were not able to start those JDBC oracle DataSource. but this DataSource are still there in JNDI registry.
Is there way to undeploy JNDI JDBC datasources?
Thanks,
Nitesh Shelar.Closing....
Solution Found None -
Get JDBC DataSource Notes from Java
Hi.
Is there any way to get Notes that are on weblogic's JDBC DataSource connection?
Notes are under console -> Data Sources -> myDataSource -> Notes. How to get these notes from my ADF application?
Thx
RegardsHi, the sample available at http://middlewaremagic.com/weblogic/?p=50 may be useful for what you are trying to achieve.
-
Different Options while creating a Datasource in Weblogic
Hi
I am using Weblogic 11 as Application Server .
While in the process of creating a DataSource in Weblogic , i came across different options such as for Instance Connections , for Service Connections.
Please tell me whats the difference in these two ??
Whats the difference in Oracle Drivers (Thin) for Instance Connections versions 9 , 10 , 11
Whats the difference in Oracle Drivers (Thin) for Service Connections 9 , 10 , 11
Thanks in advance .Hi,
Your query is replied by Joe Weistine (JDBC Expert) Please find the answer:
http://forums.oracle.com/forums/message.jspa?messageID=4029371
You can directly post your JDBC related querries to JDBC Forum directly to get to get Quick/appropriate/correct answers and attention from JDBC experts... WebLogic Server - JDBC (Forum ID)
Thanks
Jay SenSharma
Edited by: Jay SenSharma on Jan 16, 2010 10:38 AM -
JDBC datasource in weblogic 7.0
Hi
I configured coldfusion mx in weblogic 7.0 successfully.
I am able to execute cf files with 7001 port and localhost.
I need access to the remote database (oracle 8) in cf thru' dsn.
Where should I create DSN (in local system or in weblogic 7.0 connection pooling)?
How should I get access to the remote database?
If it is with connection pooling, can any one please help me how to create it and how it works?
process : req-->(cf-->weblogic)-->database(remote)
please give me asap.
pcrHi Purna,
I need access to the remote database (oracle 8) in cf thru' dsn.
Where should I create DSN (in local system or in weblogic 7.0 connection pooling)?
How should I get access to the remote database? While using Oracle thin driver, you need to install Oracle client on ur comp.
U can create a System DSN (Control Panel - Data sources ODBC)
Create a new System DSN provided Oracle client is installed on ur comp and it installs the required DLL on ur comp.
This will suffice ur DSN requirment in Coldfusion
If it is with connection pooling, can any one please help me how to create it and how it works?
process : req-->(cf-->weblogic)-->database(remote)Guess ur Cold Fusion pages will call jsp/servlets in Weblogic which in turn will tune to the remote database say Oracle.
Weblogic 7.0 's console has its way of defining a connectionPool first and then create a Datasource mapped to this ConnectionPool
In WLS Admin Console
mydomain
Services
JDBC
1. Connection Pools
Configure a New Connection Pool
Pool Name = oraclepool
url = jdbc:oracle:thin:@<machinename>:1521:<oracleservicename>
Driver classname = oracle.jdbc.driver.OracleDriver
Properties = user=xxxxxx
(Targets tab)
click on the server (In Available) to move to (Chosen)
2. Data Source
Configure a new JDBC Data Source
JNDI Name = <oraclejndi>
PoolName = oraclepool
(Targets tab)
click on the server (In Available) to move to (Chosen)
HTH,
Seetesh -
Creating txn datasource in weblogic 10.3
Hi,
Can anyone help me to create transactional datasources in weblogic 10.3. We are migrating our application from 8.1 to 10.3 and migrated existing datasources to 10.3. While executing ejb's it is giving the following error.
java.sql.SQLException: Connection has already been created in this tx context for pool named <Pool 1> Illegal attempt to create connection from another pool: <Pool 2>
In 8.1, we have only one connection pool associated with many txn datasources. In 10.3 created separate pool for each data source from same DB with following properties for txn.
--Supports global transaction with one-phase commit.
Used oracle.jdbc.OracleDriver driver class.
Thanks in advance.You need to use an XA driver to span multiple resources such as oracle.jdbc.xa.client.OracleXADataSource
See this article, which has some info on XA even if you aren't using RAC
http://www.oracle.com/technology/products/weblogic/OracleWLS_RAC.pdf -
How to create a JDBC datasource thru script/xml?
Hello All,
Is there any way to create a JDBC datasource using some script or xml file that
can be deployed to WLS 7.x?
This feature is required for our J2EE application installation program.
rgds
MSHi
See this thread for connecting SQL Server
Re: what is the process to connect to database from webdynpro ?
For Oracle
try
{DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@Oracle_server_ip:Oracle port:SID of the Database","user_name","password");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("your query");
}catch(Exception e){
see this thread
Webdynpro and Oracle
Kind Regards
Mukesh -
IO Error while creating the Datasource in WLS Console
Hello,
We are using Jdeveloper 11.1.1.1.7, I am trying to create a Data Source using WLS Console, I am getting below error
- I tried creating DB connection using SQL developer with same DB Connection info, it works fine.
- I verified the Port by logging into corresponding UNIX box where weblogic server is running, I did telnet, and able to connect.
any ideas are appreciate.
Connection test failed.
IO Error: The Network Adapter could not establish the connection<br/>oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:489)<br/>oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:678)<br/>oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:234)<br/>oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:34)<br/>oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:567)<br/>oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:404)<br/>oracle.jdbc.xa.client.OracleXADataSource.getPooledConnection(OracleXADataSource.java:674)<br/>oracle.jdbc.xa.client.OracleXADataSource.getXAConnection(OracleXADataSource.java:267)<br/>oracle.jdbc.xa.client.OracleXADataSource.getXAConnection(OracleXADataSource.java:134)<br/>weblogic.jdbc.common.internal.DataSourceUtil.testConnection(DataSourceUtil.java:314)<br/>com.bea.console.utils.jdbc.JDBCUtils.testConnection(JDBCUtils.java:734)<br/>com.bea.console.actions.jdbc.datasources.createjdbcdatasource.CreateJDBCDataSource.testConnectionConfiguration(CreateJDBCDataSource.java:474)<br/>sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br/>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)<br/>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br/>java.lang.reflect.Method.invoke(Method.java:606)<br/>org.apache.beehive.netui.pageflow.FlowController.invokeActionMethod(FlowController.java:870)<br/>org.apache.beehive.netui.pageflow.FlowController.getActionMethodForward(FlowController.java:809)<br/>org.apache.beehive.netui.pageflow.FlowController.internalExecute(FlowController.java:478)<br/>org.apache.beehive.netui.pageflow.PageFlowController.internalExecute(PageFlowController.java:306)<br/>..The Network Adapter could not establish the connection exception is caused by one or more of the following configuration errors:
The database host name, port number, or database instance name is wrong.
The database TNSListener has not been started. The TNSListener may be started with the lsnrctlutility.
C:>lsnrctl start
1. What is the connection url?
2. Is Oracle database running?
Maybe you are looking for
-
I really need help with DW cs5
I have an assignment due in my web110 class and it is due in 30 hours or I will fail that class. I have the wireframe built but can't figure out how to use my PS design and transfer those images and fonts to the wire frame can anyone help??Or send me
-
Silver Shuffle - Switch Panel Area Is White And Not Green As Apple Adverts
Hi everyone Just got the New Silver iPod Shuffle. Have a question about the top of the ipod - where the switch is, the colour is White and not Green as shown in the Apple store Pictures. Any idea? I wouldn't like to think its a fake. Reason asking is
-
FI - Payment Advice SAPScript to email
The standard SAP program RFFOUS_T runs a SAPScript to create the Payment Advice form. Is there a way to get to to PDF and email it to the vendors? Right now it just prints out then they mail it. Thanks, David
-
Currency field in Invoice Smartform
Hi all, I am printing the invoice amount field in the customized LB_BIL_INVOICE smart form in a particular window, but there are blank spaces getting printed before the amount value. I have tried moving the value into a variable too, it doesn't work
-
10.4.11 update wont let computer boot
Hi. My Mac won't boot anymore after the 10.4.11 update. I read in a few other posts about this problem, but don't really understand what needs to be done. I don't have my disks yet as I am at college and they are being mailed to me. I am also in no a