The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Tomcat 5.5.7 JDBC install instructions

Discussion in 'General Discussion' started by hostit1, Apr 27, 2005.

  1. hostit1

    hostit1 Well-Known Member

    Joined:
    Jul 24, 2003
    Messages:
    88
    Likes Received:
    0
    Trophy Points:
    0
    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
     
  2. clara

    clara Member

    Joined:
    Aug 31, 2005
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    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
     
  3. clara

    clara Member

    Joined:
    Aug 31, 2005
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Got it :
    <Host>
    <Context>
    <Realm>
    ..
    </Realm>
    </Context>
    </Host>
     
  4. Secret Agent

    Secret Agent Guest

    Is this Oracle JDBC ?
     
Loading...

Share This Page