Tomcat 5.5.7 JDBC install instructions

hostit1

Well-Known Member
Jul 24, 2003
88
0
156
Many people have posted questions on how to get JDBC working with Tomcat 5.5.7

Here is the how to:

Only perform the below if you are running Tomcat 5.5.7

1. From shell, login as root
2. perform the below commands:

wget http://hostitnow.com/downloads/updatejdbc.sh
chmod 755 updatejdbc.sh
./updatejdbc.sh
 

clara

Member
Aug 31, 2005
21
0
151
Hmm, I don't know what am I doing wrong. I got mysql connector, and did what you posted above. In tomcat's server.xml I uncommented mysql realm part, so it looks something like:

<Realm className="org.apache.catalina.realm.JDBCRealm"
driverName="org.gjt.mm.mysql.Driver"
connectionURL="jdbc:mysql://localhost/DB"
connectionName="DBUser" connectionPassword="DBPassword"
userTable="users" userNameCol="user_name" userCredCol="user_pass"
userRoleTable="user_roles" roleNameCol="role_name" />

I have this database made in CPanel, added (DBUser) and in phpAdmin created the rest. In Cpanel MYSQL administration I have this:

Connection Strings
Perl $dbh = DBI->connect("DBI:mysql:DB_DBUser:localhost","DB_DBUser","<PASSWORD HERE>");
PHP $dbh=mysql_connect ("localhost", "DB_DBUser", "<PASSWORD HERE>") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("DB_DB");
JDBC (may not be available) <%@ page import="java.sql.*" %>
Connection connection = null;
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
connection = DriverManager.getConnection(
"jdbc:mysql://localhost/DB_DB?user=DB_DBUser&password=<PASSWORD HERE>");

Can somebody please show me why my application is not communicating with DB?

thanx