|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
I am interested in invoking COM objects from my JSP Page. Can anyone help me !
Bye Martin ! |
|
#2
|
|||
|
|||
|
The JNI is probably the only chance you have which means you'll need to know some C++... why would you want to use COM anyway?
__________________
Click here and wait. It's a kewl effect, trust me. |
|
#3
|
|||
|
|||
|
I would look at J-Integra's (URL) COM-Java bridging tool. It allows you call COM objects from Java code without having to write C++ or native code. You need a pretty good understanding of how the COM object is suppose to work, but if you have that then it should work. It is pricy (about $3K) but if you are going commercial work then it will be work your time.
(BTW, I evaluated their product and it worked for the evaluation, but we were able to come up with a pure Java solution and didn't need the COM library. So I haven't bought it to use in a production environment and can't comment on that). |
|
#4
|
|||
|
|||
|
create a DNS connection employee_xls
and try the code below... import java.io.*; import java.net.*; import java.sql.*; import java.util.*; public class ReadExcell{ public static final String DRIVER_NAME = "sun.jdbc.odbc.JdbcOdbcDriver"; public static final String DATABASE_URL = "jdbc:odbc:employee_xls"; public static void main(String[] args) throws ClassNotFoundException, SQLException{ Class.forName(DRIVER_NAME); Connection con = null; try { con = DriverManager.getConnection(DATABASE_URL); Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery ("select 1stcol, 2ndcol, 3rdcol, etc... from [NAME_OF_SHEET$]"); while (rs.next()) { String ONE = rs.getString(1); String TWO = rs.getString(2); String THREE = rs.getString(3); int ETC = rs.getInt(4); //If it is int System.out.println("First: " + 1stcol + " Second: " + 2ndcol + " Third: " + 3rdcol...); } rs.close(); stmt.close(); } finally { if (con != null) con.close(); } } } |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > Invoking COM Objects from JSP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|