Getting users info using custom database integration?

Hi,

I want to get the users information from my database using openfire custom database integration and the following is my openfire.xml

Can any body please tell me what is the mistake here

<?xml version="1.0" encoding="UTF-8"?>

9090

9091

en

org.jivesoftware.database.DefaultConnectionProvider

com.mysql.jdbc.Driver

jdbc:mysql://localhost:3306/openfire?rewriteBatchedStatements=true</ serverURL>

root

123

select 1

false

false

5

25

1.0

true

com.mysql.jdbc.Driver

jdbc:mysql://localhost/openfire?user=root&password=123</c onnectionString>

org.jivesoftware.openfire.auth.JDBCAuthProvider

SELECT password FROM user WHERE username=?

sha256

SELECT name,email_address FROM user WHERE username=?

SELECT COUNT(*) FROM user

SELECT username FROM user

SELECT username FROM user WHERE

username

name

email

mysql is already a supported database. this xml is for integrating a database that is not supported

to see users, you need to open your admin UI page, then click the Users/Groups tab.

Thanks for answering.Actually I login with username and password but when I click on the users/groups tab nothing displays.

If I create a user/admin via admin UI page then that user/group is only showing.

I have some 100 users with username and password in mysql DB.I want to see those.Cant it be possible?

Please tell me how to do

your mysql usrs are not openfire users. you need to create openfire users, or integrate with LDAP.

Hi thanks again for replying

Can you please guide me how to do so?

click the User tab, then click Create User.

integrating LDAP I have not done. others have in the forums and there are a few guides available if you search for LDAP integration. I believe user Speedy has made a reletively updated guide.

Is this the same database and the same user for the jdbc auth provider?

The jdbc auth/user/group providers must not use the Openfire database.

Hi,

Yes that I have done.I have done that (click user tab then create user)

Only those users are shown that are created via openfir admin UI.But I want to know how to show users that are already created and stored in my database

Hi thanks for answering.

As you can see here jdbc:mysql://localhost/openfire?user=root&password=123</c onnectionString>

the database name is openfire.

so do you suggest not use this(openfire)

openfire has it’s own database that you setup for it by following the install guide. MySQL is a database server, openfire uses a database contained in MySQL called “openfire”. You should not create a new database called the same thing. Openfire does a lot of database caching, so manually manipulating the tables may have unexpected results.

If you are trying to programmically add users to Openfire, I would check out one of the plugins and see how they are going about doing this. There is the User Creation plugin, and also the User Import Export plugin. Both may have examples of how to programmically add users to Openfire.

You could also look at Openfire’s source code and see how it creates users when the UI buttons are clicked, etc.

The XML you are refering to is not for the purpose of mapping users into Openfire.

One usually has an existing db which is not named OPENFIRE. One can use it for auth and user queries.

But never add custom tables to the OF database.