Create A Connection Pool In the ServletContextListener
The Specification says that we should create the connection pool in the ServletContextListener. I have the code for creating a connection pool (see below). How do I create it in the ServletContextListener?
import java.sql.Connection;
import java.sql.SQLException;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
public class DBConnection
public static Connection getDBConnection() throws SQLException
Connection conn = null;
try
InitialContext ctx = new InitialContext();
DataSource ds = ( DataSource ) ctx.lookup( "java:comp/env/jdbc/MySQLDB" );
try
conn = ds.getConnection();
catch( SQLException e )
System.out.println( "Open connection failure: " + e.getMessage() );
catch( NamingException nEx )
nEx.printStackTrace();
return conn;
I use the connection pool feature provide by the server I use. Is this what I should do? Please confirm.
import java.sql.Connection;
import java.sql.SQLException;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
import javax.servlet.*;
public class CreateResources implements javax.servlet.ServletContextListener
public void contextInitialized(ServletContextEvent sce)
public static Connection getDBConnection() throws SQLException
Connection conn = null;
try
InitialContext ctx = new InitialContext();
DataSource ds = ( DataSource ) ctx.lookup( "java:comp/env/jdbc/MySQLDB" );
try
conn = ds.getConnection();
catch( SQLException e )
System.out.println( "Open connection failure: " + e.getMessage() );
catch( NamingException nEx )
nEx.printStackTrace();
return conn;
public void contextDestroyed(ServletCotnextEvent sce)
}
Similar Messages
-
How to create a connection pooling in Netbeans 6.0 using the oracle driver
hi all,
I am using Netbeans 6.0. Apache Tomcat 6.0.14 server, oracle 9i.
I tried to create a connection pooling using tomcat web server.
I have included the following code in context.xml and web.xml.
CONTEXT.XML:
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/network1">
<Resource name="jdbc/myoracle"
auth="Container"
type="javax.sql.DataSource"
username="scott"
password="tiger"
factory="BasicDataSourceFactory"
driverClassName="oracle.jdbc.OracleDriver"
url="jdbc:odbc:thin:@127.0.0.1:1521:mydb"
maxActive="20"
maxIdle="10"
maxwait="-1"/>
</Context>
WEB.XML:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<resource-ref>
<description>Oracle Datasource example</description>
<res-ref-name>jdbc/myoracle</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
After that i have included the following JDBC driver's jar files in the $Catalina_Home/lib folder.
classes 111.jar,
classes 111_g.jar
classes12.jar
classes 12_g.jar
classes12dms.jar
classes12dms_g.jar
nls_charset11.jar
nls_charset12.jar
ocrs12.jar
ojdbc14.jar
ojdbc14_g.jar
Then i stop the tomcat web server and start it again.
In jsp page i have included the following code:
Context ctx=new InitialContext();
Context envctx=(Context)ctx.lookup("java:comp:env");
DataSource ds=(DataSource)envctx.lookup("jdbc/myoracle");
Connection con=ds.getConnection(); ----->(In this line an error occured that Connection class cannot be found.)
please help me how to create a connection pooling and rectify the error in conneciton.
Thanks in advancePlease refer
http://www.netbeans.org/kb/60/web/customer-book.html -
How can i use connection pool within the sqlj?
hello
i am a beginner to sqlj,i find all of the sample code from the oracle DON'T use connectionpool,they only write the database url to "connection.properties" file,but i think in the production environment we should use the connectionpool to optimise the querying,i usually use the weblogic connection pool.
how can i use the connection pool within the sqlj?
thank you very much!Im not sure if I understand. :)
English is not my best language...
Looking up the connection again? Do you mean I have to create new DataSource object and bind it again to ServletContext? -
How to Create a connection pool in OSB java callout
Dear Team,
In our project, we need read some data from DB, and do corresponding operation. currently, we need setup the connection first, execute the SQL, and close the connection.
But the concurrency of call is very high, is there a way to create a connection pool, then we can use the connection pool to get the connection and execute the SQL, then return the connection to the pool.
if connection pool is not available, is there any way to create the connection outside the java callout, that we can just execute the SQL in java callout.
The OSB version is 11.1.1.6.0
Thanks.
Best Regards,
Raysen Jia
Edited by: Raysen Jia on Oct 16, 2012 8:44 AMHi Team,
Thanks for your help.
What I need is not only the db connection, may be other kind of things, such as read configuration from file...
If I write the code in java callout with static java method to create and close the connection, each time when request come in, OSB will create a new connection (or read the file), I think it's not the best practice to do this kind of work.
I think the weblogic is running in JVM, is there any way we can define variables or new object in the JVM directly? -
Error in creating a connection pool (No suitable driver)
I try to create a connection pool in a Weblogic server 7.0 with the following config:
URL:
jdbc:oracle:oci9:@db_name
Driver Classname:
oracle.jdbc.driver.OracleDriver
Properties(key=value):
user=user_name
password=user_password
dll=ocijdbc9
server=db_name
protocol=oci
my computer (windows 2000) has installed Oracle 9i client, and this connection
pool will connect to Oracle 8i server. Besides, I have config classes12.zip in
the "classpath" and ocijdbc9.dll in the "path" environment variables.
Can Oracle 9i driver connect to a Oracle 8i server? Or there is other problems?
Thanks in advance.Please try URL = jdbc:oracle:oci8:@db_name... that should be fine.
Yes, you can connect to 8i oracle database using 9i driver.
Also, make sure you have classes12.zip in classpath and ocijdbc9.dll in path.
Thanks,
Mitesh
Jacky Ho wrote:
I try to create a connection pool in a Weblogic server 7.0 with the following config:
URL:
jdbc:oracle:oci9:@db_name
Driver Classname:
oracle.jdbc.driver.OracleDriver
Properties(key=value):
user=user_name
password=user_password
dll=ocijdbc9
server=db_name
protocol=oci
my computer (windows 2000) has installed Oracle 9i client, and this connection
pool will connect to Oracle 8i server. Besides, I have config classes12.zip in
the "classpath" and ocijdbc9.dll in the "path" environment variables.
Can Oracle 9i driver connect to a Oracle 8i server? Or there is other problems?
Thanks in advance. -
Multiple connection pools in the same DB physical source
Hi, I have this situation in BI Admin:
A single DB with 2 physical schema and 2 Connection Pools with OCI 10/11g.
Clicking on any table I can see the data after selecting the right connection pool for that table.
I created a Business Model based upon tables from one of the 2 physical schemas and a corresponding presentation layer. It is consistent and I can view the related subject area in Answers, but when I select a Dimension column (CONVERGENZA_NEGOZIO.STATO) and the fact measure ( Convergenza_Fact.INCASSO ) in viewing results I get this error:
Odbc driver returned an error (SQLExecDirectW).
Error Details
Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17001] Oracle Error code: 942, message: ORA-00942: table or view does not exist at OCI call OCIStmtExecute. [nQSError: 17010] SQL statement preparation failed. (HY000)
SQL Issued: SELECT CONVERGENZA_NEGOZIO.STATO saw_0, Convergenza_Fact.INCASSO saw_1 FROM Convergenza ORDER BY saw_0
Is it caused by the multiple connection pools under the same DB?Yes I think that's correct, but only if you're going to use the same user to connect to them.
If you have a single user you're using to connect to a database to read data which happens to be over more than one schema, you'd use one connection pool.
However if you have entirely separate schemas (eg. different applications) and need to use a different user for each then you would use one connection pool per schema. Also if you thought you might move one of the schemas to another physical database at some point in the future it might be prudent to use a separate connection pool from the outset.
If you're still getting the error that the table cannot be found and your users have full permissions then logically the table that's being looked for does not exist, or you have not qualified it. What I mean by that is if you are connecting as USER2 and SELECT * FROM TABLE_A then the database will assume that you mean USER2.TABLE_A. If you mean USER1.TABLE_A then you need to make sure the qualification is in there.
In the admin tool check your Physical layer is set up correctly with your Physical Tables residing in the correct Physical Schemas. -
A question about creating a Connection pool that uses Oracle JDBC
Dear all,
I have an issue with creating a connection pool within a web application in order to be used by several servlets. I appreciate if you could kindly give me a hand.
I'm using:
Web server: Apache-tomcat: 6.0.18
Oracle Database 11g Enterprise: 11.1.0.6.0 - Production
Operating system: Linux (ubuntu 8.10)
IDE: Sun Netbeans
Oralce JDBC Drivers: 11.1.0.7.0-Production (ojdbc6.jar and orai18n.jar)
JDK 1.6
Usually, just for creating a connection to my database (without using a connection pool), I proceed in the following way:
String dbURL = "jdbc:oracle:thin:@localhost:1521:database01";
String username = "scott";
String user_password = "tiger";
String userSqlQuery = "SELECT * FROM mytable";
Connection connection = DriverManager.getConnection (dbURL, username, user_password);
Statement statement = connection.createStatement();
statement.executeUpdate(query_text);This works pretty well allowing to communicate with my oracle database. By this method I have run several projects
with different queries (SELECT, INSERT, UPDATE, DELETE ,etc.) and each time it worked without any problem and
returned the result of the query. Therefore I think that there is no problem with JDBC drivers
However, when I want to create a connection pool, it seems that the lookup method cannot locate Oracle JDBC drivers. That is,
try
InitialContext ic = new InitialContext();
Context envContext = (Context)ic.lookup("java:/comp/env");
dataSource = (DataSource)envContext.lookup("jdbc/oracle11gEnterprise");
Connection connection = dataSource.getConnection();
catch (Exception e)
e.printStackTrace();
}Just after calling dataSource.getConnection() the java.lang.NullPointerException is thrown.
Any idea?
Thanks in advance,
And for your information, here are context.xml and web.xml files for my project
Here is my context.xml
<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/WebApplication1">
<Resource name="jdbc/oracle11gEnterprise"
scope="Shareable"
type="javax.sql.DataSource"
auth="Container"
description="Oracle Database 11g Enterprise"
maxActive="100"
maxIdle="30"
maxWait="10000"
removeAbandoned="true"
removeAbandonedTimeout="60"
logAbandoned="true"
url="jdbc:oracle:thin:@localhost:1521:database01"
username="scott"
password="tiger" />
</Context>my web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<ConsumeOutput>false</ConsumeOutput>
<resource-ref>
<res-ref-name>jdbc/oracle11gEnterprise</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<!--
. And here as usual I write servlet definition and url mappings
-->nobody?
-
Problem creating a connection pool for mssql server
Hi
i downloaded the microsoft type 4 driver for JDBC and i have installed it. now i am trying to create a connection pool for MS Sql server but each time i ping i keep getting an error telling me
Operation 'pingConnectionPool' failed in 'resources' Config Mbean. Target exception message: Connection could not be allocated because: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket
please can someone help out on this
IfeanyichukwuI assume that you installed the driver correctly. You did go into the app sever admin and set the JVM path? You do this by going to Application Server | JVM Settings | Path Settings and putting in an entry for Classpath Prefix.
If that is done and it's not something basic like your database isn't turned on, then it must be your settings. To to Sun's site and search for dbping. http://developers.sun.com/prodtech/appserver/utilities/dbping/dbping_overview.html
Deploy this program and run it. It is a very simple tool that lets you test different property settings. Play around with different settings until you get a ping.
If that doesn't work post your connect pool settings.
Good luck
Mike -
Error While Creating Informix Connection Pool
Hi,
I am trying to port an application from Weblogic 6.1 to Weblogic 8.1. The Application accesses Informix database. I used the following driver, url and properties while connecting to this database using Weblogic 6.1
url:->jdbc:weblogic:informix4:snss_live
Driver ClassName :-> weblogic.jdbc.informix.InformixDriver
Properties :->
port=22000
user=snssadmn
password=snssadmn
server=10.115.26.40
The above used to work fine with weblogic 6.1
With Weblogic 8.1, I am using the following properties
url :-> jdbc:bea:informix://10.115.26.40:22000;informixServer=10.115.26.40;databaseName=snss_live
Driver ClassName :-> weblogic.jdbc.informix.InformixDriver
Properties :->
informixServer=10.115.26.40
user=snssadmn
portNumber=22000
databaseName=snss_live
serverName=10.115.26.40
However using these properties I am getting the following error while deploying the Connection Pool to the Managed Server
<Dec 29, 2004 12:26:53 PM EST> <Warning> <JDBC> <BEA-001129> <Received exception while creating connection for pool "Btv_Vms_Pool": [BEA][Informix JDBC Driver][Informix]INFORMIXSERVER does not match either DBSERVERNAME or DBSERVERALIASES.>
<Dec 29, 2004 12:26:54 PM EST> <Error> <JDBC> <BEA-001150> <Connection Pool "Btv_Vms_Pool" deployment failed with the following error: 0:Could not create pool connection. The DBMS driver exception was: [BEA][Informix JDBC Driver][Informix]INFORMIXSERVER does not match either DBSERVERNAME or DBSERVERALIASES..>
Any idea as to why this is happening
Regards
Nitin NairHi. I suspect that the databaseName property is causing the problem in
8.1. Remove it and see if that works. Also, try running:
java utils.dbping, and giving it the properties it asks for, for your
Informix connection. Once it succeeds in making a connection, it will
print out the URL and properties it used. Then define the pool with
those (and only those) properties and URL.
Joe
Nitin Nair wrote:
Hi,
I am trying to port an application from Weblogic 6.1 to Weblogic 8.1. The Application accesses Informix database. I used the following driver, url and properties while connecting to this database using Weblogic 6.1
url:->jdbc:weblogic:informix4:snss_live
Driver ClassName :-> weblogic.jdbc.informix.InformixDriver
Properties :->
port=22000
user=snssadmn
password=snssadmn
server=10.115.26.40
The above used to work fine with weblogic 6.1
With Weblogic 8.1, I am using the following properties
url :-> jdbc:bea:informix://10.115.26.40:22000;informixServer=10.115.26.40;databaseName=snss_live
Driver ClassName :-> weblogic.jdbc.informix.InformixDriver
Properties :->
informixServer=10.115.26.40
user=snssadmn
portNumber=22000
databaseName=snss_live
serverName=10.115.26.40
However using these properties I am getting the following error while deploying the Connection Pool to the Managed Server
<Dec 29, 2004 12:26:53 PM EST> <Warning> <JDBC> <BEA-001129> <Received exception while creating connection for pool "Btv_Vms_Pool": [BEA][Informix JDBC Driver][Informix]INFORMIXSERVER does not match either DBSERVERNAME or DBSERVERALIASES.>
<Dec 29, 2004 12:26:54 PM EST> <Error> <JDBC> <BEA-001150> <Connection Pool "Btv_Vms_Pool" deployment failed with the following error: 0:Could not create pool connection. The DBMS driver exception was: [BEA][Informix JDBC Driver][Informix]INFORMIXSERVER does not match either DBSERVERNAME or DBSERVERALIASES..>
Any idea as to why this is happening
Regards
Nitin Nair -
Error: Creating a Connection Pool: issue with valid transaction levels
Server: SunOS 5.8 Generic_117350-27 sun4u sparc SUNW,UltraAX-MP
App Server: Sun Java System Application Server 8.2
Jar: ojdbc14.jar
Datasource Classname: oracle.jdbc.pool.OracleConnectionPoolDataSource
Resource Type: javax.sql.ConnectionPoolDataSource
[Issue]
Using /SUNWappserver/lib/ojdbc14.jar, when I create my connection pool in Sun Java System Application Server 8.2, I return the following error each time I try to start the domain:
[#|2006-07-28T14:53:56.169-0500|WARNING|sun-appserver-pe8.2|javax.enterprise.resource.resourceadapter|_ThreadID=11;|RAR5117 : Failed to obtain/create connection. Reason : The isolation level could not be set: READ_COMMITTED and SERIALIZABLE are the only valid transaction levels|#]
When I change the value to "SERIALIZABLE" in my domain.xml file, I receive the following error in my server.log:
Caused by: org.xml.sax.SAXParseException: Attribute "transaction-isolation-level" with value "SERIALIZABLE" must have a value from the list "read-uncommitted read-committed repeatable-read serializable ".
So, I'm stuck!
I can't use the values READ_COMMITTED or SERIALIZABLE since the valid values are "read-uncommitted read-committed repeatable-read serializable ".
Case sensitivity matters.
Any thoughts or help would be greatly appreciated.
Thanks,
--ToddThe Oracle JDBC accepts TRANSACTION_READ_COMMITTED and TRANSACTION_SERIALIZABLE isolation levels.
Example:
connAttr.setProperty(“TRANSACTION_ISOLATION”, “TRANSACTION_SERIALIZABLE”);
I'd check with the Apps server folks.
Kuassi - blog http://db360.blogspot.com/
------ book http://www.amazon.com/gp/product/1555583296/ -
Is it possibel to create one connection [pool for one report only
Hi is it possibe to create one connection pool for one report only. Others report are running from the another connection pool under same DB.
Thanks,Hi,
Why do u want seperate connectionpool for that single report?
I dont think its possible.Direct database request will be good solution for this.Try importing those columns which are used to build that report into physical layer and create new subject area.Not sure weather its right way to do.
Regards,
Srikanth -
Error creating a connection pool to DB2 with the weblogic 8.1 driver
I am trying to create a new connection pool with using the weblogic 8.1 (non XA driver (weblogic.jdbc.db2.DB2Driver)). When I create the pool one of the steps is to test the driver configuration and it fails with this step.
I get the following error:
[BEA][DB2 JDBC Driver]The databaseName connection property is not valid when connecting to Host Operating Systems.
We are going through IBM's DB2 connect gateway (version 8.x) to connect to a DB2 database running on Z/OS.
Here are my connection parameters:
Driver Classname: weblogic.jdbc.db2.DB2Driver
url: jdbc:bea:db2://db2cont2.arrow.com:3700
Database User Name: XXXXXX
password xxxxx
properties
user=db2trce
portNumber=3700
databaseName=DB2T
batchPerformanceWorkaround=true
serverName=db2cont2.arrow.com
Any ideas would be much appreciated.
Thanks,
MattMatthew McHugh wrote:
I am trying to create a new connection pool with using the weblogic 8.1 (non XA driver (weblogic.jdbc.db2.DB2Driver)). When I create the pool one of the steps is to test the driver configuration and it fails with this step.
I get the following error:
[BEA][DB2 JDBC Driver]The databaseName connection property is not valid when connecting to Host Operating Systems.
We are going through IBM's DB2 connect gateway (version 8.x) to connect to a DB2 database running on Z/OS.
Here are my connection parameters:
Driver Classname: weblogic.jdbc.db2.DB2Driver
url: jdbc:bea:db2://db2cont2.arrow.com:3700
Database User Name: XXXXXX
password xxxxx
properties
user=db2trce
portNumber=3700
databaseName=DB2T
batchPerformanceWorkaround=true
serverName=db2cont2.arrow.com
Any ideas would be much appreciated.
Thanks,
MattHi Matt. Unfortunately DB2 is different on differnet OSes. For
DB2 on OS/390, z/OS, iSeries, and AS/4001, the URL is like this:
jdbc:bea:db2://db2_server_name:port;Location=db2_location;CollectionId=your_collectionname
Try removing the serverName property and the databaseName, and
change your URL to
jdbc:bea:db2://db2cont2.arrow.com:3700;Location=db2_location;CollectionId=your_collectionname
where you would change 'db2_location' and 'your_collectionname' as appropriate.
Joe -
Error while creating JDBC connection pool for MSSQL database
Hi,
From my windows m/c, I am trying to configure a connection pool to connect to
an MSSQL database on another m/c. While setting the targets, i get the error :-
<Mar 11, 2004 6:17:52 PM GMT+08:00> <Error> <JDBC> <Cannot startup connection
pool "gcdb_connpool" Cannot load driver class: com.microsoft.jdbc.sqlserver.SQLServerDriver>
I have added the path of the jars for the driver in the classpath.
Any help would be appreciated.
Thanks.Hi. Read the weblogic startup script, and follow how it creates
a classpath argument for the server. You must get the driver jars
into that classpath.
Joe
Neha wrote:
Hi,
From my windows m/c, I am trying to configure a connection pool to connect to
an MSSQL database on another m/c. While setting the targets, i get the error :-
<Mar 11, 2004 6:17:52 PM GMT+08:00> <Error> <JDBC> <Cannot startup connection
pool "gcdb_connpool" Cannot load driver class: com.microsoft.jdbc.sqlserver.SQLServerDriver>
I have added the path of the jars for the driver in the classpath.
Any help would be appreciated.
Thanks. -
Error creating a connection pool (No suitable driver)
I have just installed WLS6.1 SP3
I try to create a connection with the following parameters
URL = jdbc:oracle:thin@myOracleServer:1521:myOracleSID
DriverName = oracle.jdbc.driver.OracleDriver
every thing else is left as the defaults,
when I click create everything is OK.
I then go to the "Targets" tab and select myserver,
move it to the chosen column and click apply.
I then get the error
<Error> <JDBC> <Cannot startup connection pool "myCP" No suitable driver>
I looked at the doc edocs.bea.com/wls/docs61/jdbc/thirdparty.html
Under the section "Setting environment for your third party driver"
it implys that if your using sybase jconnect or oracle thin drivers
you do not need to do anything else.
I looked in the weblogic.jar file and the OracleDriver.class file
is there under oracle\jdbc\driver.
the CLASSPATH=.;.\lib\weblogic_sp.jar;.\lib\weblogic.jar
I would have thought that the driver class in the jar file
would have be picked up given the path & classname match the
driver name enter in the console.
Any ideas on how to fix this problem?"Robert Towler" <[email protected]> wrote in message
news:3dd3ea04$[email protected]..
Thanks Slava, you were correct,
I really appreciate it.Glad to help :)
Regards,
Slava Imeshev
"Slava Imeshev" <[email protected]> wrote:
Hi Robert,
Looks like colon is missing after jdbc:oracle:thin. The url should be
jdbc:oracle:thin:@myOracleServer:1521:myOracleSID
Regards,
Slava Imeshev
"Robert Towler" <[email protected]> wrote in message
news:3dd3e3c6$[email protected]..
I have just installed WLS6.1 SP3
I try to create a connection with the following parameters
URL = jdbc:oracle:thin@myOracleServer:1521:myOracleSID
DriverName = oracle.jdbc.driver.OracleDriver
every thing else is left as the defaults,
when I click create everything is OK.
I then go to the "Targets" tab and select myserver,
move it to the chosen column and click apply.
I then get the error
<Error> <JDBC> <Cannot startup connection pool "myCP" No suitable
driver>
>>>
I looked at the doc edocs.bea.com/wls/docs61/jdbc/thirdparty.html
Under the section "Setting environment for your third party driver"
it implys that if your using sybase jconnect or oracle thin drivers
you do not need to do anything else.
I looked in the weblogic.jar file and the OracleDriver.class file
is there under oracle\jdbc\driver.
the CLASSPATH=.;.\lib\weblogic_sp.jar;.\lib\weblogic.jar
I would have thought that the driver class in the jar file
would have be picked up given the path & classname match the
driver name enter in the console.
Any ideas on how to fix this problem? -
Creating a connection pool using SQL Server 2000, Sun ONE Application Serve
Has any one succesfully configured SQL Server 2000 to work with Sun ONE Application Server 7 on Windows 2000 server service pack 4? I am embarking on a new J2EE project and I need to configure it as soon as possible.
The problem I am having is that, when I ping the data souce name, there is a connection error.
I have set the data source name and other details as follows:
Under JDBC, I have set the parameters for the connection pool as follows:
Data Source Name: com.microsoft.jdbc.sqlserver.SQLServerDriver
Database Name: jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=Test
User: test
Password: test
In the JVM settings page, I have set the prefix class path as follows for the location of the Microsoft JDBC
drivers that I downloaded as follows:
c:\microsoft\drivers/lib/msbase.jar
c:\microsoft\drivers/lib/msutil.jar
c:\microsoft\drivers/lib/mssqlserver.jar
Under JVM Options, there is a strange setting which I don't understand: perhaps this is the cause of the
connction error?
-Djdbc.drivers=com.pointbase.jdbc.jdbcUniversalDriver
Please help????I'm in a similar boat...
Trying to setup AS7 JDBC and followed the instructions on the link you provided and get the following exception. I kept the case the same, thinking 'setpassword" was incorrect, so I tried changing the property to "Password", but get the same exception but it points to "setPassword" instead.
SEVERE: RAR5041:Cannot get jdbc connection
com.sun.enterprise.repository.J2EEResourceException
java.lang.NoSuchMethodException: setpassword
at com.sun.enterprise.repository.JdbcConnectionPool.createDataSource(JdbcConnectionPool.java:243)
at com.sun.enterprise.resource.JdbcUrlAllocator.createResource(JdbcUrlAllocator.java:80)
at com.sun.enterprise.resource.IASNonSharedResourcePool.createSteadyResources(IASNonSharedResourcePool.java:856)
at com.sun.enterprise.resource.IASNonSharedResourcePool.initPool(IASNonSharedResourcePool.java:416)
at com.sun.enterprise.resource.IASNonSharedResourcePool.internalGetResource(IASNonSharedResourcePool.java:625)
at com.sun.enterprise.resource.IASNonSharedResourcePool.getResource(IASNonSharedResourcePool.java:520)
at com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:263)
at com.sun.enterprise.resource.JdbcXAConnection.<init>(JdbcXAConnection.java:74)
at com.sun.enterprise.resource.Jdbc10XaAllocator.createResource(Jdbc10XaAllocator.java:94)
at com.sun.enterprise.resource.IASNonSharedResourcePool.createSteadyResources(IASNonSharedResourcePool.java:856)
at com.sun.enterprise.resource.IASNonSharedResourcePool.initPool(IASNonSharedResourcePool.java:416)
at com.sun.enterprise.resource.IASNonSharedResourcePool.internalGetResource(IASNonSharedResourcePool.java:625)
at com.sun.enterprise.resource.IASNonSharedResourcePool.getResource(IASNonSharedResourcePool.java:520)
at com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:263)
at com.sun.enterprise.resource.PoolManagerImpl.getResource(PoolManagerImpl.java:170)
at com.sun.enterprise.resource.JdbcDataSource.internalGetConnection(JdbcDataSource.java:241)
at com.sun.enterprise.resource.JdbcDataSource.getConnection(JdbcDataSource.java:98)
at com.rvi.database.jdbcConnection.getConnection(jdbcConnection.java:93)
at com.webapp.database.ArticlesDAO.selectByYear(ArticlesDAO.java:102)
at com.webapp.actions.ArticleAction.list(ArticleAction.java:96)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157)
at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
Maybe you are looking for
-
How to upload file on Application Server with Forms 6i?
Please, I need to upload .csv file from local to Application Server, I think to use .jsp application, but I don't know where I had to put it...Apache can't read .jsp file without Tomcat? If I launch my .jsp file from Apache/htdocs directory can't vie
-
Hi, I have installed pre-built VM on my mac osx lion. Everything is running smothl except Oracle Enterprise Manager login. I couldn't figure out login useername and password. Will anyone please help me what is the username and password? Thanks. Abdul
-
Regarding report painter&report writer
Hi All, Please could you anyone explain me how to create report writer &report painter its important. Thanks®ards Anjum
-
Plot editor in LabVIEW.
Hello, In MATLAB there is an option to save the plot as *.png or other formats and also somethink like *.fig. Later when the user wants to check the plot he can load the *.fig file into the figure editor and can be edited which makes easy for the use
-
Can not read shared variable on cRIO, error -1950678968 nitaglv
Hardware setup: Laptop Laptop connected via USB to a frammer garber. Laptop IP: 192.168.0.2 NI vision calculating a diameter and setting a network varaible cRIO cRIO connected to the laptop cRIO IP: 192.168.0.1 Project has the shared variable in the