ken zhu

Greenhorn
+ Follow
since Apr 09, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by ken zhu

Dear All,

I have a problem on how to get a Domain Account from client
Such as:
I have a domain called: ABC, and there have a domain user called: ACCT001
And i have a web based application: http://My IP/test, Then how to get user's domain account (ACCT001) from application?

Any suggestion will be high appreciate.
14 years ago
Below is the error messageļ¼š
"HTTP Status 405 - HTTP method GET is not supported by this URL
--------------------------------------------------------------------------------
type Status report
message HTTP method GET is not supported by this URL
description The specified HTTP method is not allowed for the requested resource (HTTP method GET is not supported by this URL)."


web.xml
============================================
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>*.shtml</url-pattern>
</servlet-mapping>
=============================================

dispatcher-servlet.xml
=============================================
<beans>

<bean id="commonController" class="com.nxp.apg.dorm.controller.CommonController"/>

<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="/Common*">commonController</prop>
<prop key="/test.shtml">commonController</prop>
</props>
</property>
</bean>


<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass">
<value>org.springframework.web.servlet.view.JstlView</value>
</property>
<property name="suffix"><value>.jsp</value></property>
</bean>

</beans>

when i open "http://myIp:8080/dorm/Common.shtml" in IE then got the error message which i posted, i don't know what's happen? Any suggestion will be high appreciated.
14 years ago
Below is the error messageļ¼š
"HTTP Status 405 - HTTP method GET is not supported by this URL
--------------------------------------------------------------------------------
type Status report
message HTTP method GET is not supported by this URL
description The specified HTTP method is not allowed for the requested resource (HTTP method GET is not supported by this URL)."


web.xml
============================================
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>*.shtml</url-pattern>
</servlet-mapping>
=============================================

dispatcher-servlet.xml
=============================================
<beans>

<bean id="commonController" class="com.nxp.apg.dorm.controller.CommonController"/>

<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="/Common*">commonController</prop>
<prop key="/test.shtml">commonController</prop>
</props>
</property>
</bean>


<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass">
<value>org.springframework.web.servlet.view.JstlView</value>
</property>
<property name="suffix"><value>.jsp</value></property>
</bean>

</beans>

when i open "http://myIp:8080/dorm/Common.shtml" in IE then got the error message which i posted, i don't know what's happen? Any suggestion will be high appreciated.
14 years ago
Mike Sven,

could you paste your relevant sourcecode and DB & APP server version?
remove the earlier mysql driver jar(mysql-connector-java-5.0.3-bin.jar) to try.
btw, you don't need paste so lot of error message since it raised by container.
You are right after tried, thanks a lot.
Our 'DBA'(actually we have no a real one) change DB configuration and set server as dedicated mode.
Then i found i can't use DBCP connection pool and we use normal jdbc, but it need long time to establish a connection.
So, would i ask how your web application apply which connect DB way? What happen to me?

below code is our connect DB now:
====================================

Kiran Joshi wrote:Try to check execution plan of the sql query in the database.
Check this when your servlet is firing the sql query.
There could be some issue with the indexes of the database tables involved in the query.



Thanks your reply.
The sql query is very simple just like 'select sysdate from dual' and i executed it in toad or sqlplus, it's very fast.
Just when invoke in servlet it will become slow sometimes, i don't know whether have matter with jdbc driver version or other unknown reason?
hi everyboy:

i met a strange issue in my j2ee project, i got connection from tomcat dbcp(connection pool) when i
call ResultSet resultSet = pst.executeQuery(sql) it's became very slow need 100 seconds sometime,
1, but i execute the SQL in toad is very fast and it's very simple in fact
2, but when i open or refresh other servlet which also need invoke database, the previous page will load successful very fast.

I don't know how to explain these strange issues and what's the root cause.

Thanks for your hint.

Jan Cumps wrote:It's better to create a new topic when you want to discuss a problem not related to the OP subject. (ah - you did that already)


Yes, i did. But nobody reply me and i found this topic is similar with it so.....

Jeanne Boyarsky wrote:

RaviNada Kiran wrote:can you please tell me what are the conditions on which the the container decides to return the Connection instance to the pool .


They aren't specified and might not be deterministic. I'm having trouble picturing why you need to know this. If you always close your connections, this is never a problem.


yes, anyway connection pool program have a mechanism to get the connection when timeout or unuseful connection check triggered.
but close it explicitly is good custom.

Actually, i have met the issue, my environment is oralce9i+jdk1.4+ojdbc14.jar
i don't know why get a connection from pool is slow to me, and the connection haven't back to pool although i closed.
Thanks for your any suggestion .

**
* java file1 named ServerInformationInit, initinal connection pool cache. Any update need?
*
*/
public static OracleDataSource ods = new OracleDataSource(); // is a statci variable will be used in other java file
prop.setProperty("MinLimit", "5");// set cache properties
prop.setProperty("MaxLimit", "20");
prop.setProperty("InitialLimit", "5");
prop.setProperty("ConnectionWaitTimeout","3");
prop.setProperty("InactivityTimeout", "3");
ods.setConnectionCachingEnabled(true); // be sure set to true
ods.setConnectionCacheProperties(prop);
ods.setConnectionCacheName("eform_db_cache"); // this cache's name
url = "jdbcracle:thin:@" + EformAplProperty.getDbHostName() + ":" +
EformAplProperty.getDbPort() + ":" + EformAplProperty.getDbSid();
ods.setURL(url);
ods.setUser(EformAplProperty.getDbUserName());
ods.setPassword(EformAplProperty.getDbPassword());


/**
* java file 2 named DefnSqlManager is all DAO file's parent
*/
connection = ServerInformationInit.ods.getConnection();
...............
OracleConnectionCacheManager occm =
OracleConnectionCacheManager.getConnectionCacheManagerInstance();
System.out.println
(occm.getNumberOfAvailableConnections("eform_db_cache")
+ " connections are available in cache " + "eform_db_cache");
System.out.println
(occm.getNumberOfActiveConnections("eform_db_cache")
+ " connections are active");

/**
* java file 3 named QaCmptCaseSqlManager extend DefnSqlManager, which retrieve data from database
*/
sqlMgr = new QaCmptCaseSqlManager();
cmptEntity = sqlMgr.genCmptCaseDoc(docId)
finally {
sqlMgr.closeDbConn();
}

below message is printed in console:
4 connections are available in cache eform_db_cache
14 connections are active
3 connections are available in cache eform_db_cache
15 connections are active
4 connections are available in cache eform_db_cache
14 connections are active
3 connections are available in cache eform_db_cache
15 connections are active
2 connections are available in cache eform_db_cache
2 connections are available in cache eform_db_cache
16 connections are active
16 connections are active

As you see, the connections are available in cache is less and most of connections are in active.
The result is system will create more and more connection for application, i don't what wrong about it ?

Filename toad_sessiones.JPG Download
Description the sessiones in toad are equal to java connectiones?
Filesize 55 Kbytes
Downloaded: 1 time(s)

the original url is https://coderanch.com/t/440913/Oracle-OAS/ojdbc-jar-connection-pool-cache

Joe Ess wrote:ojdbc14.jar is for JDK versions 1.4 and above.



Does it have any relation with database version like Oracle 9i or Oracle 10g?
15 years ago
/**
* java file1 named ServerInformationInit, initinal connection pool cache. Any update need?
*
*/
public static OracleDataSource ods = new OracleDataSource(); // is a statci variable will be used in other java file
prop.setProperty("MinLimit", "5");// set cache properties
prop.setProperty("MaxLimit", "20");
prop.setProperty("InitialLimit", "5");
prop.setProperty("ConnectionWaitTimeout","3");
prop.setProperty("InactivityTimeout", "3");
ods.setConnectionCachingEnabled(true); // be sure set to true
ods.setConnectionCacheProperties(prop);
ods.setConnectionCacheName("eform_db_cache"); // this cache's name
url = "jdbcracle:thin:@" + EformAplProperty.getDbHostName() + ":" +
EformAplProperty.getDbPort() + ":" + EformAplProperty.getDbSid();
ods.setURL(url);
ods.setUser(EformAplProperty.getDbUserName());
ods.setPassword(EformAplProperty.getDbPassword());


/**
* java file 2 named DefnSqlManager is all DAO file's parent
*/
connection = ServerInformationInit.ods.getConnection();
...............
OracleConnectionCacheManager occm =
OracleConnectionCacheManager.getConnectionCacheManagerInstance();
System.out.println
(occm.getNumberOfAvailableConnections("eform_db_cache")
+ " connections are available in cache " + "eform_db_cache");
System.out.println
(occm.getNumberOfActiveConnections("eform_db_cache")
+ " connections are active");

/**
* java file 3 named QaCmptCaseSqlManager extend DefnSqlManager, which retrieve data from database
*/
sqlMgr = new QaCmptCaseSqlManager();
cmptEntity = sqlMgr.genCmptCaseDoc(docId)
finally {
sqlMgr.closeDbConn();
}

below message is printed in console:
4 connections are available in cache eform_db_cache
14 connections are active
3 connections are available in cache eform_db_cache
15 connections are active
4 connections are available in cache eform_db_cache
14 connections are active
3 connections are available in cache eform_db_cache
15 connections are active
2 connections are available in cache eform_db_cache
2 connections are available in cache eform_db_cache
16 connections are active
16 connections are active

As you see, the connections are available in cache is less and most of connections are in active.
The result is system will create more and more connection for application, i don't what wrong about it ?
15 years ago

vanlalhmangaiha khiangte wrote:Hi ,
Do you mean the sessions ?

You can do it thro



Hope this helps .



i don't know whether you are familiar with java, since i aslo have a question:
what the relation between oralce session and java connection, i mean whether i open a connection in java program then oralce have a active session and if i close conneciton then the session will become inactive or non-display.

thanks.
15 years ago
Actually, i also have this confusion.
Many articles said ojdbc14.jar is oralce10g jdbc driver, so what are their relation between JDK version(JDK1.4/JDK1.5/JDK1.6) AND Oracle database version(Oracle 9i/10g) AND JDBC Driver Version(classes12.jar/ojdbc14.jar) ?

our project is JDK1.4+Oralce9.2+ojdbc14.jar and i don't whether is good or not .
15 years ago

Thiwanka Somasiri wrote:But I have heard that it can be hacked although we use the POST method. How to do that?



for sensitive data posted, you can use HTTPS(HTTP+SSL) way or encrypt data to avoid got by the third party.
else you don't need care this.
15 years ago