• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Connection String

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

How to make a connection String to connect to JForum db?.as a sample i asks a simple questien.

I m having mysql-4.1.1-alpha as database server.

My username to connect the database is "root" and there is no password.

I m having com.mysql.jdbc.Driver as database driver to connect to database in my classpath and i m using that driver.

I m having a database named "mydatabase".

I wanna use a connection String to connect to that database.i does'nt wanna create a datasource name etc.else i need a connection String to connect to the database.

How to create a connection String?.Or what will be my connection String?.i hav provided all data above to create one.

thanks in advance.


[originally posted on jforum.net by shaba]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I hav used

jdbc:mysql://localhost:3306/mydatabase?user=root&password=&autoReconnect=true

as connection String.

but not connecting.in which Tomcat version JForum tested?.now i think it's a tomcat problom.




[originally posted on jforum.net by shaba]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
when tomcat loads,it shows an error like,

WebappClassLoader : validateJarFile (TOMCAR_ROOT\webapps\JForum-RC3\WEB-INF\lib\Servlet-api.jar) not loaded.See Servlet spec 2.3 section 9.7.2 offending class :javax.servlet.Servlet.class

this is the problom i getting if i use a connection String like above.how to solve?


[originally posted on jforum.net by shaba]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

shaba wrote:when tomcat loads,it shows an error like,

WebappClassLoader : validateJarFile (TOMCAR_ROOT\webapps\JForum-RC3\WEB-INF\lib\Servlet-api.jar) not loaded.See Servlet spec 2.3 section 9.7.2 offending class :javax.servlet.Servlet.class

this is the problom i getting if i use a connection String like above.how to solve?



this error is not there if i remove Servlet-api.jar from lib directory.

i hav changed mysql server as 3.1. now everything is fine.
[originally posted on jforum.net by shaba]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think it's better to remove the servlet-api.jar anyway...
[originally posted on jforum.net by Daniil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

shaba wrote:when tomcat loads,it shows an error like,

WebappClassLoader : validateJarFile (TOMCAR_ROOT\webapps\JForum-RC3\WEB-INF\lib\Servlet-api.jar) not loaded.See Servlet spec 2.3 section 9.7.2 offending class :javax.servlet.Servlet.class

this is the problom i getting if i use a connection String like above.how to solve?



Just ignore this.

You *may* have some problem if you are using tomcat4, but tomcat must not load that servlet-api.jar anyway. If your tomcat apps are not working because this jar, just remove from the lib dir.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I deleted servlet-api.jar file from lib directory.

Then, it's fine.
[originally posted on jforum.net by Anonymous]
 
Do you want ants? Because that's how you get ants. And a tiny ads:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic