PDA

View Full Version : Problem in implementing PHP project in a Java environment using the QUERCUS


andreluiz1111
05-15-2011, 07:19 PM
During the project execution in a PHP environment using JAVA QUERCUS that the following problems:
1. A PHP project running normally in XAMPP (apache) accessing bank POSTGRES, encoding LATIN1 via ODBC
2. In NetBeans 6.9.1 has been installed Quercus and the PHP Project
3. The project JAVA accesses the same database from PHP and displays the contents of the fields correctly (in Portuguese accent)
4. When the JSP page calls the PHP, it runs normally but the displayed contents of the bank does not recognize LATIN1 encoding (accents and characters in Portuguese)
5. It is as if done in Java via JDBC access recognizes the POSTGRES database with encoding LATIN1, but when you run PHP page accessing the database with encoding POSTGRES LATIN1 via any ODBC configuration is incompatible.

domdorn
05-19-2011, 01:58 PM
Hello,

could you please clarify some thing?

Are you referring to ODBC or JDBC?
Quercus does not have support for ODBC but uses JDBC to connect to PostgreSQL.

What do you mean by "When the JSP page calls the PHP" ?
Are you accessing PHP from a JSP page?
Please post some code on how you're doing this.

Point 5: Are you saying, that when accessing the PostgreSQL Database from Quercus, the output is messed up? Have I understood this correctly? I'm still not sure, if we're talking about ODBC or JDBC here - please clarify.

andreluiz1111
05-20-2011, 03:14 PM
We are including a PHP project that already exists in Windows / tomcat / quercus.
The PHP project as shown below is configured to access postgres database via ODBC.
All the Java classes created access the same database via JDBC.
The problem is how to run PHP pages without changing the code of the PHP project.
How do I change the outside configuration of PHP to access the postgres ODBC database, so that the Windows / tomcat / quercus can understand.
Example configuration of the ODBC driver for the database accessed by the PHP project.



When run on Windows / Apache works normally
The problem occurs when I'm on Windows ambienete / tomcat / quercus, where the implementation has an error in displaying attributes of the bank with accentuation.

The project follows the following procedures:
1. Initiated by the index.jsp page,
2. Accesses the database to check postgres url to be called in case default.php

index.jsp

3. This page defaul.php typically run in a Windows apache.
It connects to postgres database via ODBC, where there are several pages running on this type of access.

4. How do I embed an existing php project, where all access is already configured to postgres via ODBC? how to migrate without much code change?

5. Running on Windows / tomcat / quercus he normally access the postgres database, but does not display LATIN1 (set to ISO-8859-1, is that correct or should be CP1252)


When running on Windows / Tomcat / Quercus, a PHP page, every execution of html is displayed correctly, but the attributes accessed from the database are shown with error.

In the example below, the HTML is correct, but the attributes accessed from the bank with this error



Because the Windows / tomcat / quercus can run a PHP page that already exists and is configured to access the database via ODBC?

Example snippet of PHP code with passing parameters to access the postgres database.

andreluiz1111
05-20-2011, 03:24 PM
Examples of images in previous post.

Model configuration for PHP ODBC and ACCESS BANK POSTGRES example of error in the display of attributes, where correct html code and display the bank attributes the problem.

Follow the attached example index.jsp page that will call and PHP
excerpt from the PHP page that will connect to postgres database via ODBC.

There is a possibility to change this setting to access external form without changing the existing PHP code?