Error in connecting to the mySQL database in TOMCAT using more than one PC (database connection pooling)
how do i implement connection pooling with tomcat5.5?
i have updated context.xml
<Context path="/HTHL" docBase="webapps/HTHL"
debug="5" reloadable="true" crossContext="true" >
<!-- Default set of monitored resources -->
<WatchedResource>WEB-INF/web.xml</WatchedResource> <Resource name="jdbc/HTHLogDB" auth="Container" type="javax.sql.DataSource"
maxActive="10" maxIdle="15" maxWait="10000"
removeAbandoned="true" removeAbandonedTimeout="60" logAbandoned="true"
username="msos" password="passw0rd" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://10.9.58.8:3306/alcs_htht"/> </Context>
and web.xml
<web-app>
<description>HTHLogweb</description>
<resource-ref>
<description>HTHLog DB Connection</description>
<res-ref-name>jdbc/HTHLogDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<session-config>
<session-timeout>35</session-timeout>
</session-config>
<mime-mapping>
<extension>html</extension>
<mime-type>text/html</mime-type>
</mime-mapping>
<mime-mapping>
<extension>txt</extension>
<mime-type>text/plain</mime-type>
</mime-mapping>
<welcome-file-list>
<welcome-file>/login.jsp</welcome-file>
</welcome-file-list>
</web-app>
and connected with the following code
public static final String strDataSource = "java:comp/env/jdbc/HTHLogDB";
ic = new InitialContext();
ds = (DataSource)ic.lookup(strDataSource);
con = ds.getConnection();
I was able to successfully connect using one PC. But when I use another PC to access the same application/database, I get a java.lang.NullPointer Exception.
Can you help me?
I tried using DriverManager.getConnection, and I can work with two or more PCs, however this will not be efficient, as it will create one-to-one connection. (16PCs - 16 connection)
Need your help badly.
Thanks!
View Answers
Related Tutorials/Questions & Answers:
Connecting to MYSQL Database in JavaConnecting to
MYSQL Database in Java I've tried executing the code... the
connection driver and configured the class path but the
error persists. Please...("
MySQL Connect Example.");
Connection conn = null;
String url
Advertisements
jsp -sevlet connecting to database using dropdownjsp -sevlet
connecting to
database using dropdown How can I get my dropdown list from oracle
database and then submit it to another table in JSP. I... to the
database and fetches an array of strings from a
database table and then sends
Error with LogIn with mysql databaseError with LogIn with
mysql database Hi,
I have followed steps from your tutorial titled SpringMVClogin with
database. I am not
using Jetty, as I have
Tomcat as my server
using Eclipse IDE. When I run the program I get a Http
Connecting to a database through the Proxy.Connecting to a
database through the Proxy.
Connecting to a
database through the Proxy I want to connect to remote
database using a program that is running in the local network behind the proxy. Is that possible
database connectivity using mysqldatabase connectivity
using mysql java file: eg1.java
package eg... seconds)
I am
using Netbeans 5.5,
mysql server 5.0, to get data from table...[]) throws SQLException
{
try
{
String connectionURL = "jdbc:
mysql Connecting to a MySQL Database in Java Connecting to a
MySQL Database in Java
... on
connecting to a
MySQL database, after going through
this program you... of program:
This program establishes the
connection between
MySQL
database and java
connecting to database - Strutsconnecting to database Hi
I am having problems with
connection to MS SQL Server 2005
database.
My first is what do i write in struts... information via the
database in my web page.
Thanks
Tayo Hi friend
Using MYSQL Database with JSP & Servlets. database. We will use
tomcat
web server to run over web application which acceres the
MYSQL
database. Here I am
using MYSQL &
tomcat server...
Using MYSQL Database with JSP & Servlets.
Connecting JTable to database - JDBCConnecting JTable to database Hi..
I am doing a project on Project... to store this JTable content in my
database table..
This is a very important...("sun.jdbc.odbc.JdbcOdbcDriver");
Connection connect =DriverManager.getConnection
connecting to access database this there is no
error but my data is not going to my Acess
Database.
There is working exception which I wrote("SQL
ERROR") Please help me to slove this problem. here...
connecting to access database print("code sample");Hi I Write java
error oracle database connection?error oracle
database connection? hi now i am trying to connect oracle
database and also insert my data into table, but it's not working.. I created
one user registration form. when i give values in the form, i want stored data
connection database errorconnection database error import java.awt.EventQueue; // import...{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection...;which type of
error occurs? Specify it.
Is NWIND is your dsn
database connection by using java beandatabase connection by
using java bean i need a code for bean class to connect to
mysql database.
subsequently to use dis bean class whereever i need 2 connect 2
database connecting with database - Strutsconnecting with database I am creating an application where when jsp page is displayed, it contains the combo box where data is populated from the database.it has 3 buttons and the functionality for all buttons is different
Problems connecting to a database. Java/SQLiteProblems
connecting to a
database. Java/SQLite `print("try {
con...("
error al buscar la base de datos");
}");`
I am trying to do my first querys on an SQL
database but i am having problems
connecting to it, I think the problem
Image upload in mysql database using jsp servletImage upload in
mysql database using jsp servlet Hello, I need code to insert image in
mysql database, I have seen the code which is already in your portal but it is not inserting image into
database it save in the folder
connecting to a database dynamically - JSP-Servletconnecting to a
database dynamically
abc.html... encountered an internal
error () that prevented it from fulfilling this request... is available in the Apache Tomcat/6.0.14 logs.
I want to establish
connection Connection to Database is the code how I am
connecting to
MySQL: I am
connection to
MySQL database in 2...
Connection to Database Hello,
I have a website with
more than 50... is that Joomla is also
using MySQL.
The question is that why I get
error messages when
MYSQL DatabaseMYSQL Database Can any
one brief me about how to use
MYSQL Database..., the
MySQL database server is most popular
database server and if you want to know about creating table and
using MYSQL, just follow the below link
login page using jsp servlrt with mysql database?login page
using jsp servlrt with
mysql database? Description:
example:total users are 3.each use have username and password save in
mysql database table login.
After successfully login
user1 see only index page,if user2 login
How to get more than one value from ajaxHow to get
more than one value from ajax I have multiple select list box in php. i filled the value
using ajax. how to get different value to fill the same list box
Ex.
option value as id
(adsbygoogle
databasedatabase I wanted to know if it is possible to establish
database connection on a remote
pc with
mysql using java swings from netbeans and then create a
database on the remote
pc....
Kindly help me
Creating a Database in MySQL
Creating a
Database in
MySQL
After establishing the
connection with
MySQL
database by
using... the
connection with
MySQL database
and takes a
database name as its input