473,799 Members | 3,065 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mysql connectionprope rtiestransform issue - help needed

3 New Member
Hi,

I have implemented com.mysql.jdbc. ConnectionPrope rtiesTransform class.

In the jdbc connection url, I have added

propertiesTrans form=com.mysql. jdbc.Connection PropertiesTrans formImpl

attribute.

I made jar of this implementation class file and i have placed this jar file inside webapps/ (application)/WEB-INF/lib. mysql-connector-java-5.0.4-bin.jar file is present inside \tomcat\common\ lib.


I am getting following exception.

Unable to create the properties transform instance 'com.mysql.jdbc .ConnectionProp ertiesTransform Impl' due to underlying exception java.lang.Class NotFoundExcepti on: com.mysql.jdbc. ConnectionPrope rtiesTransformI mpl


If I place mysql-connector-java-5.0.4-bin.jar inside webapps/ (application)/WEB-INF/lib, its working fine.


Any idea? Is it classpath/class loader issue?

Thanks in advance
Oct 22 '08 #1
3 1727
sukatoa
539 Contributor
Hi,

I have implemented com.mysql.jdbc. ConnectionPrope rtiesTransform class.

In the jdbc connection url, I have added

propertiesTrans form=com.mysql. jdbc.Connection PropertiesTrans formImpl

attribute.

I made jar of this implementation class file and i have placed this jar file inside webapps/ (application)/WEB-INF/lib. mysql-connector-java-5.0.4-bin.jar file is present inside \tomcat\common\ lib.


I am getting following exception.

Unable to create the properties transform instance 'com.mysql.jdbc .ConnectionProp ertiesTransform Impl' due to underlying exception java.lang.Class NotFoundExcepti on: com.mysql.jdbc. ConnectionPrope rtiesTransformI mpl


If I place mysql-connector-java-5.0.4-bin.jar inside webapps/ (application)/WEB-INF/lib, its working fine.


Any idea? Is it classpath/class loader issue?

Thanks in advance
I think it is on the catalina.proper ties file, ( not sure )

compare the values of common.loader and server.loader variables,
what have you notice?

Im not sure and i cannot confirm it(since i have uninstalled already my tomcat)

but if you would like to try, have a back-up copy of catalina.proper ties

add this at the end of server.loader --> ,${catalina.hom e}/common/lib/*.jar

eg.

server.loader=$ {catalina.home}/server/classes,${catal ina.home}/server/lib/*.jar,${catalin a.home}/common/lib/*.jar

save, restart your Tomcat Server and observe,

If you still cannot use the jar files inside the common/lib, replace the modified one with the unmodified(back-up) catalina.proper ties and stay on the WEB-INF/lib/ folder...... :)

regards,
sukatoa
Oct 23 '08 #2
samathak
3 New Member
I think it is on the catalina.proper ties file, ( not sure )

compare the values of common.loader and server.loader variables,
what have you notice?

Im not sure and i cannot confirm it(since i have uninstalled already my tomcat)

but if you would like to try, have a back-up copy of catalina.proper ties

add this at the end of server.loader --> ,${catalina.hom e}/common/lib/*.jar

eg.

server.loader=$ {catalina.home}/server/classes,${catal ina.home}/server/lib/*.jar,${catalin a.home}/common/lib/*.jar

save, restart your Tomcat Server and observe,

If you still cannot use the jar files inside the common/lib, replace the modified one with the unmodified(back-up) catalina.proper ties and stay on the WEB-INF/lib/ folder...... :)

regards,
sukatoa

Thank you very much..

Let me explain my issue clearly..

Actually, i need to login to database using application user login name and password. So after user has logged in , i need to get username and password and make the database connection using that..

So i am using ConnectionPrope rtiesTransform and changing the database connection parameters.

Right now, I have two jar files.

1) mysql-connector
2) my application custom jar.

If i place my jar inside web-inf/lib , i am getting noclassdeffound exception.

If i have placed my jar inside common/lib, since i am using spring framework outside web application, SecurityContext Holder /Authentication objects are coming null. So i am not able to retrieve user details..

If i place mysql jar inside web-inf/lib, jndi connection to database is not establishing.

I have played with catalina.proper ties. it does not solve my problem. After changing common-loader, i am not getting no class definition found error. But Securitycontext holder /Authentication objects are coming null..


So please suggest me if there is any solution for this?
Oct 23 '08 #3
sukatoa
539 Contributor
Thank you very much..

Let me explain my issue clearly..

Actually, i need to login to database using application user login name and password. So after user has logged in , i need to get username and password and make the database connection using that..

So i am using ConnectionPrope rtiesTransform and changing the database connection parameters.

Right now, I have two jar files.

1) mysql-connector
2) my application custom jar.

If i place my jar inside web-inf/lib , i am getting noclassdeffound exception.

If i have placed my jar inside common/lib, since i am using spring framework outside web application, SecurityContext Holder /Authentication objects are coming null. So i am not able to retrieve user details..

If i place mysql jar inside web-inf/lib, jndi connection to database is not establishing.

I have played with catalina.proper ties. it does not solve my problem. After changing common-loader, i am not getting no class definition found error. But Securitycontext holder /Authentication objects are coming null..


So please suggest me if there is any solution for this?
( i haven't use spring framework before )
If i were to implement that, since the requirement ( username and password ) that will be used as a username/password for the database to connect,

im going to create a bean that manage database connection( pooling using naming-factory-dbcp.jar )
with a constructor parameter URL, DriverLocation, Schema, Username and Password,
( DriverManager needs URL(jdbc:mysql://localhost/ ), username and password)

Following the setter/getter methods for the constructor parameter to be able to make it a dynamic connection switching....

Every time the username and password changes, close the current connection instance and reconnect it using the new username and password together with all other parameters initialized.

Having its own simplified executeQuery and executeUpdate methods and a closeConnection method that will invoked only after executeQuery method ( since the ResultSet returned must be used first in any desired transaction before closing a connection )

And i will be used it as my Database connection manager.

I also haven't use the com.mysql.jdbc. ConnectionPrope rtiesTransform class,
but i think the goal is the same, please do correct me if im wrong,

I believe that all programmer/developer defined jar files are recommended to put them in WEB/INF/lib directory, since the content of a WAR file that will be used for deployment are the ROOT/["USER"] directory under myapps folder.....

i hope that it will make sense to you,

regards,
sukatoa
Oct 24 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
3950
by: Mike Chirico | last post by:
Interesting Things to Know about MySQL Mike Chirico (mchirico@users.sourceforge.net) Copyright (GPU Free Documentation License) 2004 Last Updated: Mon Jun 7 10:37:28 EDT 2004 The latest version of this document can be found at: http://prdownloads.sourceforge.net/souptonuts/README_mysql.txt?download
3
7009
by: Nick | last post by:
hi, all I have a red hat 9 and looks like it had mysql 3.2.54 installed before, but, actually not, i can not find the install folder and I can not uninstall it. So I am trying to install/upgrade to 4.1, but, still can not get it work. Here is what I did: # rpm -Uvh MySQL-server-standard-4.1.14-0.rhel4.i386.rpm warning: MySQL-server-standard-4.1.14-0.rhel4.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
2
3451
by: Sam White | last post by:
I have set up a MySQL db on one server, IIS 6.0 on another. Using Frontpage I created some forms to input data. On a test page I made, I have 4 fields. First is the ID which is autonumber (I leave alone). The second is marked as TEXT, the third is MEDIUMTEXT, and the fourth is DATE. This is just an example though, the problem exists in no matter what manner I create the form. Now here is the issue. In the TEXT fields nothing is saved...
33
5602
by: Joshua D. Drake | last post by:
Hello, I think the below just about says it all: http://www.commandprompt.com/images/mammoth_versus_dolphin_500.jpg Sincerely, Joshua Drake
175
11520
by: Sai Hertz And Control Systems | last post by:
Dear all, Their was a huge rore about MySQL recently for something in java functions now theirs one more http://www.mysql.com/doc/en/News-5.0.x.html Does this concern anyone. What I think is PostgreSQL would have less USP's (Uniqe Selling Points
1
2832
by: Good Man | last post by:
Hi there I've noticed some very weird things happening with my current MySQL setup on my XP Laptop, a development machine. For a while, I have been trying to get the MySQL cache to work. Despite entering the required lines to "my.ini" (the new my.cnf) through notepad AND MySQL Administrator, the cache does not work. So, today I took a peek at the 'Health' tab in MySQL Administrator.
15
4647
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to communicate with a MySQL database table on a web server, from inside of my company's Access-VBA application. I know VBA pretty well but have never before needed to do this HTTP/XML/MySQL type functions.
0
1754
by: Sam Flywheel | last post by:
Hello, all: I am pleased to announce that the MySQL Journal is moving forward. During the past two weeks, I've been discussing the journal with MySQL AB, and the plan that's been devised benefits all involved, including authors, readers, the community, and MySQL AB.  Let me outline how the journal will operate: * The name of the magazine is Tabula: The Journal of MySQL Development.
15
1294
by: Cirene | last post by:
I'm trying to convince my client that MySQL server is not the way to go for his project. Here are some reasons why... - If you use the MySQL Connector you are bound to GPL (unless you want to pay $$$) - Doesn't work as good "out of the box" with Visual Studio 2008 Any other reasons why SQL Server is better than MySQL? I was thinking about using SQL Express, but my client says it's too limited. Any thoughts? Thanks!
1
1437
by: samathak | last post by:
Hi, I have implemented com.mysql.jdbc.ConnectionPropertiesTransform class. In the jdbc connection url, I have added propertiesTransform=com.mysql.jdbc.ConnectionPropertiesTransformImpl attribute.
0
10491
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10268
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10031
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7571
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6809
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5593
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4146
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.