CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 server-database per user connection

Print topic Send  topic

Author Message
bujarek

Posts: 5
Posted: 11/27/2010, 3:50 AM

Hello,

I'm looking for a solution/tip regarding the server side to database connection in CodeCharge Studio.

The problem to solve is: how to make the server-side code to use per-user login/passord instead of a single (per-server) login/passwd.

I have an existing database with accounts created for many users, tables with granted roles, etc. that is why I need to use database authentication instead of one common database connection.

Is it at all possible with CodeCharge?
View profile  Send private message
datadoit
Posted: 11/27/2010, 7:49 PM

What's your database and what is your scripting language?
bujarek

Posts: 5
Posted: 11/28/2010, 1:18 AM


Database is oracle, i'm using jdbc connector, language is java, javascript.
View profile  Send private message
datadoit
Posted: 11/28/2010, 6:46 AM

Forgive me if this sounds patronizing, but do you realize you're not
really using just -one- database connection, but rather one connection
per -session-? Those connections then become part of your connection
pool, which increases performance. You can always cross-connect those
database connections via user sessions after they've authenticated to
find out who's who for logging purposes, if that's the goal.

More questions... Wouldn't you have to make a connection somewhere to
get the login/password information for the user to begin with? or would
that come from some sort of environment variable?

Perhaps you're using LDAP/AD to authenticate a desktop session, and want
to use that?
bujarek

Posts: 5
Posted: 11/28/2010, 9:42 AM

Quote datadoit:
Forgive me if this sounds patronizing, but do you realize you're not
really using just -one- database connection, but rather one connection
per -session-? Those connections then become part of your connection
pool, which increases performance. You can always cross-connect those
database connections via user sessions after they've authenticated to
find out who's who for logging purposes, if that's the goal.

More questions... Wouldn't you have to make a connection somewhere to
get the login/password information for the user to begin with? or would
that come from some sort of environment variable?

Perhaps you're using LDAP/AD to authenticate a desktop session, and want
to use that?

No, desktop session authentication is not to be any part of this application authorization.

Ok, maybe I am simplifying it too much, but what I need is:
for the server to use login-password (for the actual database connection) that would be provided by the user on the login form. Instead of standard setup where server uses predetermined login/password for all the database connections for all user sessions.
The database will verify user/password - the CC code needs only to verify if the connection was successful.

Of course, many users can log in at the same time, so the server code would need to use different user/password for each session.

View profile  Send private message
drudd9

Posts: 1
Posted: 11/28/2010, 7:58 PM

I thought this was the way CodeCharge already worked - one user for one session.
View profile  Send private message
datadoit
Posted: 11/29/2010, 5:57 AM

To answer your question: No, this can't be done with CodeCharge, nor any
packaged connector that I'm aware of.

You could script it, but you're well beyond the parameters of what a
RAD/IDE is used for. You 'might' be able to alter the accompanying
connector script (db_jdbc.jsp?), but altering CCS generated code is
playing with fire. It'll eventually burn you.
Oper


Posts: 1195
Posted: 12/05/2010, 7:19 AM

Do you mean if user A login, he will be signed and using to one database
if user B login he will signed and using another database?

That?




Quote bujarek:
Quote datadoit:
Forgive me if this sounds patronizing, but do you realize you're not
really using just -one- database connection, but rather one connection
per -session-? Those connections then become part of your connection
pool, which increases performance. You can always cross-connect those
database connections via user sessions after they've authenticated to
find out who's who for logging purposes, if that's the goal.

More questions... Wouldn't you have to make a connection somewhere to
get the login/password information for the user to begin with? or would
that come from some sort of environment variable?

Perhaps you're using LDAP/AD to authenticate a desktop session, and want
to use that?

No, desktop session authentication is not to be any part of this application authorization.

Ok, maybe I am simplifying it too much, but what I need is:
for the server to use login-password (for the actual database connection) that would be provided by the user on the login form. Instead of standard setup where server uses predetermined login/password for all the database connections for all user sessions.
The database will verify user/password - the CC code needs only to verify if the connection was successful.

Of course, many users can log in at the same time, so the server code would need to use different user/password for each session.



_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message
bujarek

Posts: 5
Posted: 12/08/2010, 5:22 AM


That would work for me as well.
I will use the same database for user A and user B. But I need two separate connections.

Quote Oper:
Do you mean if user A login, he will be signed and using to one database
if user B login he will signed and using another database?

That?
View profile  Send private message
Oper


Posts: 1195
Posted: 12/08/2010, 5:42 AM

maybe we are missing something here,

every user will create a different conection always.


could you go back and explain not what you want todo. but instead what is the problem.
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message
bujarek

Posts: 5
Posted: 12/29/2010, 12:24 PM

Quote Oper:
maybe we are missing something here,
every user will create a different conection always.
could you go back and explain not what you want todo. but instead what is the problem.

A database with user accounts is already created (for many users, with tables and roles, etc.)

The problem is that the web application has to use the database login/password that the user provides.
Many users = many different database logins,
different users = different database passwords,
different users = different database access rights
and all above already is done and is supposed to be controlled by the database, not the web application.

I'm sure this is doable with some coding.
View profile  Send private message
Oper


Posts: 1195
Posted: 12/30/2010, 4:31 AM

so what you are trying to do is a Change the Connection on the

2 Aplliacation

1) The onen where user login and set the session variable Security.

2) The Main Apliaction that will open a Custom Connection

---------------
What todo:

* Use the Same Session Security
* Send with URL or Session variable the name of the Database that the main variable will Open.
Check this Link:
http://www.informatica.com.do/ContentComent.asp?cid=50
(This is the tricky Part)

of course you will have to handle the database security and the ON ERRORs for Connections.


we are doing the same with 2 different thing: 1) the Security Database is on Access Database
the Core Database is on MYSQL 2) and Depending on the Database we are using subddomain.

Subdomain to Permit different user logged in same machine to diferent Database.













_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.