Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
7 replies
Subscribers
5 subscribers
Views
5612 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Plug-Ins
Unable to get an Oracle connection.
mayankk210
over 8 years ago
Hi,
I am using the following piece of code in order to get an oracle connection in a custom smart service plugin :-
public static Connection openNewConnection(String url, String username, String password) throws ClassNotFoundException, SQLException {
DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
Connection connection = DriverManager.getConnection(url, username, password);
return connection;
}
It works perfectly fine as a standalone, but when used inside an Appian custum plugin, it gives "ClassCastExcepton" with the following message :-
"oracle.jdbc.driver.T4CConnection cannot be cast to oracle.jdbc.OracleConnection".
Any clues to this issue ?
OriginalPostID-235583
Discussion posts and replies are publicly visible
0
mayankk210
over 8 years ago
PS : I have used this with ojdbc5.jar, ojdbc6.jar, ojdbc7.jar and ojdbc14.jar files respectively.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
chandu
A Score Level 2
over 8 years ago
Hi Mayankk210 will this link help you?
developer.jboss.org/.../205507
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
narlayellaraghavendrar
over 8 years ago
I went through it. It didn't help. Don't know what exactly is causing issue.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
mayankk210
over 8 years ago
Hi chandrasekharg, I tried this, but it didn't work.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Justin
Appian Employee
over 8 years ago
If the connection can be defined in your application server configuration, then you can leverage this documentation:
forum.appian.com/.../Accessing_JNDI_Data_Sources_in_Plug-ins_Best_Practices.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
mayankk210
over 8 years ago
Hi Justin, I tried using connection from datasource as well (like it is given in the link you shared), but the issue remained the same.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Justin
Appian Employee
over 8 years ago
What do you mean by "issue remained the same"? Are you saying even with a JNDI lookup, you get a ClassCastException, or a different error? Have you tried looking at how some existing shared components, like ExcelTools, handle these connections? For example, ExcelTools has a Export SQL To Flat File service that does an ad-hoc RDBMS connection as the documentation indicates. I know this plugin works with Oracle datasources so it might be a good starting point. I also recommend sharing your plugin project with Appian Support via support case, and the assigned engineer might be able to help.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel