datasource 2 « DataSource « Java Database Q&A





1. How to create DataSource with Apache DBCP 1.4?    stackoverflow.com

I'm trying this:

final PoolableConnectionFactory factory = new PoolableConnectionFactory(
  new DriverManagerConnectionFactory("jdbc:hsqldb:mem:testdb", "sa", ""),
  new GenericObjectPool(null),
  null,
  "SELECT 1 from INFORMATION_SCHEMA.SYSTEM_USERS",
  true,
  false,
  Connection.TRANSACTION_NONE
);
DataSource ds = ...

2. mongoimport to load one collection with two data sources    stackoverflow.com

Can mongoimport command be used to populate already populated collection, but with a different json structure? I'm able to load the data, but it's not getting inserted into the collection as per ...

3. How to display two grids with different data on the same form    stackoverflow.com

I have a form with two grids. I have one table with rows where each row has a status of Yes or No. I'd like to display all the ...

4. cacti: Display how much % one data source item has of an other datasource item    stackoverflow.com

I want to create a graph template in which it is displayed how much percentage a data source item has of another data source item. I assumed I'd need to use CDEF ...

5. Infragistics UltraGrid (9.2) count Band after DataSource is set    stackoverflow.com

In an inherited UltraGrid I would like know how many Bands the grid contains after I set a new value on base.DataSource. How do I find that count? Thanks -a- /**Added screendump**/ (code is not ...

6. Datasource    bytes.com

Thanks for posting part of your code good buddy... I suspect you ar using a bean, is that it? I'll fetch your notes later and see what can be salvaged. In ...

7. exp occurs Data source not found    bytes.com

Can you provide some more information? The code would be a good start and then some details on the className you are using. Once we have the details we should be ...

8. IO data sources adapter    bytes.com

9. Grails datasource sleep mode    forum.springsource.org

Grails datasource sleep mode hi i am new to Grails application development. i have developed a application and it is in production server a problem in my datasource connection I tried ...





10. Connect to data source when making web report with Java reporting tool    forums.netbeans.org

Background When users are making web report, they always have to connect to data source. As users' data requirements are differ in thousand ways, so users often need to define data ...

11. Data input solution after changing data source dynamically in Java reporting tool    forums.netbeans.org

Posted: Tue Jul 28, 2009 3:05 pm Post subject: Data input solution after changing data source dynamically in Java reporting tool Problem Sometimes, users may change the data ...

12. Resolve Data Source when restall solaris    forums.netbeans.org

13. Checking data source definitions question    forums.netbeans.org

hi all ! first post here. I want to clarify this doubt. I have my web app working and in my apps' lib I have the latest mysql-jbdc driver. But when ...

14. Connect to data source when making web report with Java reporting tool RAQ Report    forums.netbeans.org

Posted: Wed Nov 18, 2009 2:13 pm Post subject: Connect to data source when making web report with Java reporting tool RAQ Report Background When users are ...

15. JavaFX Charts using JDBC Data Source    forums.netbeans.org

Hello, I have been experimenting with the JavaFX Bar Chart using the NetBeans IDE 6.9. I have keyed in values for Data, Category Axis and Value Axis to populate my charts. Now I would like to populate my charts with data from a JDBC Data Source. I have two choices in the chart Data dialog box... - Use value resolved from ...

16. ORA-01000 in Data Source Customizer: SQL Query> Create    forums.netbeans.org

Hi, I'm new to Netbeans and trying to create a simple desktop application using instructions at http://netbeans.org/kb/docs/javafx/database-client.html. Instead of the DB listed in the tutorial, I'm trying to connect to one of our test databases, which has a large number of tables. The data source has been created successfully and I'm able to see all the schemas and tables. But when ...





17. Edit JDBC Data Source entries in Netbeans    forums.netbeans.org

1) Search for the data source name you would like to delete in the windows (In my case it was "mysql") and click see more results. 2) Select a details view and sort the results by date. 3) Delete or modify the persistence.xml to remove the data source. I just deleted 4 persistence.xml files because all the files only contained the ...

18. NB7 - get rid of unresolved data source problem    forums.netbeans.org

Hi, recently one of my projects keeps reporting that I need to "resolve a datasource", despite the fact that the datasource is set up and the project works perfectly fine. If I try and fix it by adding a connection as prompted, it makes no difference to the error which still remains. Can anyone tell me where the netbeans is looking ...

19. Adding a data source    forums.netbeans.org

Hello everyone, I am currently enrolled in a database course in my college. I am using NetBeans to build a simple web application. The application should link to my SQL database. I have installed the jTDS driver and linked my database, which I can see in NetBeans. The documentation has says that I should be able to drag the table I ...

20. Change datasource during test    jmeter.512774.n5.nabble.com

Hi all, I have currently a test plan that simulates 1000 SOAP requests to a web service (with 100 users each doing 10 iterations). Each request contains binary data that I get in a datasource with 1000 lines. This works properly. Now, I'd like to run the test plan indefinitely (100 users, infinite number of iterations), using multiple datasources successively. I ...

21. Use substring from datasource    jmeter.512774.n5.nabble.com

Hi, I need to get a substring from a datasource and use it as a sampler parameter. Of course I can provide the substring as part of the datasource, but I find it more elegant to retrieve the substring directy from the datasource itself. Does anybody know how to do this? D.

22. using XML as a data source instead of csv?    jmeter.512774.n5.nabble.com

Is it possible (without custom module) to use XML as a data source? I cannot use CSV and parameterization of values in generic XML (just take my word for it) for my specific testing. And need to use the XML which has about 4000 nodes containing several elements. Something like this: ...

23. Converting data source    coderanch.com

there is some package called javazoom which is used to upload the files u can upload it to any where from server just search in net i was sending some sample code ****************************code*********************** <%@ page language="java" import="javazoom.upload.*,java.util.*" %> <%@ page errorPage="ExceptionHandler.jsp" %> Samples : Simple Upload

24. Adding byte[ ] as a DataSource    coderanch.com

25. Reading from multiple input sources and storing into multiple data sources    coderanch.com

Hi, I have got to write a standalone Java Program and the specifications are as follows: The program takes inputs from Various files and Writes into different data sources . The intial inputs and the data sources are The Inputs are a)XML b)Comma Separated Text File The Data Sources are 1.Oracle Data Source 2.An Active Directory At a given point of ...

26. How to use DataSource    coderanch.com

27. URL setup for data source    coderanch.com

Can anyone tell me what this code actually does Properties properties = new properies(); properties.put(Context.PROVIDER_URL, "iiop://192.168.3.134"); I am using the webshphere environment. When i try to run this code it just brings up the debugger and sits there not even a crash or an errormessage. If anyone has some sample code of this working i would love to see it. By ...

28. JDBC 2.0 DataSource    coderanch.com

29. DataSource....    coderanch.com

Before you can "look up" an object, you must first bind the object to a context. MyDataSource dataSource = new MyDataSource(); Contex c = new InitialContext(); context.bind( "collo/apps", dataSource); In the above lines, we created a data source, which represents your connection pool, then we created an IntitialContext so we could "bind" the object to an alias -- in this case ...

30. Code to creat a Data Source    coderanch.com

Hi I am using an Access database for an application and I am wanting to make it as easy to set up on a windows machine as possible Is there any way to set up a data source for a database using code instead of having to go to control panel and set it up manually. any pointers much appreciated Thanks ...

31. javax.sql.DataSource    coderanch.com

32. DataSource?????    coderanch.com

36. How to actually create a Datasource    coderanch.com

38. Weird problem ..Using Datasource to get result    coderanch.com

Hi All, I am facing a problem which I am unbale to find root cause. But I think it is because of way I am querying DB. Here is my approach. I have singleton class that is responsible for handling all DB queries and is using Datasource. DS in instance variable and I am initializing it in static Initializer. Now I ...

39. how to use javax.sql.DataSource    coderanch.com

40. Using DataSource Question    coderanch.com

This shouldn't be possible. The connection does come from a pool, but a single client should have exclusive use of it until it is closed. When the client calls close on this connection, it isn't closed in the traditional sense, but rather returned to the pool. Only then could another client retrieve it. What makes you think you are getting the ...

41. how does data source work?    coderanch.com

42. How does using DataSource make Code more portable ?    coderanch.com

Originally posted by Vishal Saxena: hello, Without it too, the driver/db info. can be read from a file - it need not be hard coded in the class. With it too - the DataSource properties will be read from a file to bind it, the jndi info will again be read from a file for lookup. regards, Hi, In a distributed ...

43. Q on cached datasource    coderanch.com

Hello, We are on WAS3.5. We are caching the datasource at a particular initialization point and from there on this same datasource is being used for all further database connections. Lets assume that at some point in time, the database goes down. Obviosuly the datasource will not be able to get any connections and will keep throwing SQLExceptions. Now when the ...

44. Using a Datasource to connect to database    coderanch.com

Hi everyone, I'm making a small application in tomcat to get some practice with jsp. I really need some stratagy to using database connections because at the moment I have to set up a new connection every time I want to use the database. So, I understand the concepts of connection pooling but when I looked a bit further I began ...

46. javax.sql.DataSource Question    coderanch.com

47. Data Source    coderanch.com

HI all I have 5 Tables in Oracle 8i...Huv to bind a datasource name to all these tables... Where to register the data source name , i am using Tomcat 3.2.. Can anybody give an example for all 4 types of Drivers when the database is Oracle.. What type conncetion(Class.forname()..or ctx.lookup("datasource name")) is good ... expecting response from all u priya ...

48. Datasource question    coderanch.com

What happens if a datasource is created with a id and a password and then an application developer gets a connection using Connection conn = ds.getConnection("other_id","other_password") ; Does it create a new pool of connections with this new id or gets a new connection everytime user requests for one? Can anyone please explain what really happens here!!

49. Retrieving a List of All ODBC/JDBC Data Sources    coderanch.com

All, I have a need in my application to present the user with a list of all available ODBC/JDBC data sources so he or she can select one. After searching Google, the closest thing I found was the following: //////////////////////////////////////////////////////////////////// Enumeration enum = DriverManager.getDrivers(); System.out.println(" Before - while (enum.hasMoreElements())"); while (enum.hasMoreElements()) { System.out.println("Has Driver"); System.out.println(enum.nextElement().toString()); } System.out.println(" After - while (enum.hasMoreElements())"); ...

50. DataSource and ConnectionPool    coderanch.com

Off the top of my head, I'd say: A Connection Pool is a database-specific implementation of the Broker Pattern. Connection Pools also imply pools that grow or shrink depending on requirements, and have other functionality like making sure the Connections don't become broken or stale. It is designed to manage database Connection resources. A DataSource is a distributed connection manager. It ...

51. DataSource    coderanch.com

52. Datasource session timeout problem    coderanch.com

53. JDBC and DataSource    coderanch.com

54. DataSource implementation    coderanch.com

55. Datasource    coderanch.com

56. New To Java - JDBC DataSource Independent Code - design suggestions    coderanch.com

Hi, I get a jndi name from the UI based on which I make a connection and create statement. I have stored the table_name_constant,table name and column_name_constant,column name in a table. Once Connection is obtained i am creating the two maps as below. keyvaluekeyvalue ======================================== | ======================================= table_name_constant - Actual Table Name | column_name_constant - Actual Column Name I am building ...

57. Creating a Datasource    coderanch.com

58. Setting up a DataSource outside an AS    coderanch.com

Hey all. I have the following code to create a datasource outside a container : (the following code is from a tutorial at developerWorks) package com; import com.microsoft.jdbc.sqlserver.SQLServerDataSource; import java.util.Hashtable; import javax.naming.*; import javax.naming.directory.*; import java.sql.* ; import javax.sql.DataSource; public class InitSQLServer { String fsName = "jdbc/ToddDB" try { Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory"); Context ctx = new InitialContext(env); ...

60. DataSource    coderanch.com

62. Help in DataSource    coderanch.com

63. Bad practice with datasource?    coderanch.com

64. Unable to get a PooledConnection from the DataSource    coderanch.com

Hi pls tell me waht is the problem when i tried to connect to my SQL by datasource : [4/26/05 15:23:23:048 PDT] 6f825a96 FreePool E J2CA0046E: Method createManagedConnctionWithMCWrapper caught an exception during creation of the ManagedConnection for resource jdbc/DBDatasource, throwing ResourceAllocationException. Original exception: com.ibm.ws.exception.WsException: DSRA8100E: Unable to get a PooledConnection from the DataSource. at com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.(DataStoreAdapterException.java:244) at com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.(DataStoreAdapterException.java:171) at com.ibm.ws.rsadapter.AdapterUtil.createDataStoreAdapterException(AdapterUtil.java:208) at com.ibm.ws.rsadapter.DSConfigurationHelper.getPooledConnection(DSConfigurationHelper.java:706) ...

65. Multiple DataSources    coderanch.com

66. error in data source    coderanch.com

67. using datasource help    coderanch.com

Hi, I configured a datasource and got it to work following the apache tutorial here http://tomcat.apache.org/tomcat-5.0-doc/jndi-datasource-examples-howto.html. For my application I guessed I needed to put this code in the init() method of my default servlet so it would be run before any requests come in. Context ctx = new InitialContext(); if(ctx == null ) throw new Exception("Boom - No Context"); DataSource ...

68. Reading from multiple input-sources and storing into multiple data-sources    coderanch.com

Hi, I have got to write a standalone Java Program and the specifications are as follows: The program takes inputs from Various files and Writes into different data sources . The intial inputs and the data sources are The Inputs are a)XML b)Comma Separated Text File The Data Sources are 1.Oracle Data Source 2.An Active Directory At a given point of ...

69. 2 EARs Sharing 1 Data Source    coderanch.com

Hi, EAR file 1 opens connections when needed and then closes after done. While EAR file 1 may be running, EAR file 2 needs to connect to the same datasource. But it seems that EAR file 2 can never get a connection from the pool. Please see the following errors I get. ***************** J2CA0045E: Connection not available while invoking method queueRequest ...

70. datasource object problem    coderanch.com

i want to know how to change the properties of the datasource object i have datasource object for database connection with some properties.if there is change in the server,then i need to change these properties.how to do that. i made a alternate attempt to make a file and write all parameters in that file(username,password etc)but everytime i make a connection i ...

71. why do we need datasource    coderanch.com

72. about datasource close?    coderanch.com

73. Program using DataSource...    coderanch.com

74. Cost of creating DataSource...    coderanch.com

Hi . Actually I meant what impact would it make on my application performance if such calls are made frequantly. As of now , i'm using WSAD and working with pooled connections only. But , due to some design issues , I need to make such calls frequently. so, i wanted to know the seriousness of such calls. In my env ...

75. DataSource invalid    coderanch.com

77. javax.sql.DataSource query?    coderanch.com

Hello, I am using following code to creating connection pool. Context ctx = null; Hashtable ht = new Hashtable(); ht.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"); ht.put(Context.PROVIDER_URL, "t3://" + "IP:PORT"); ctx = new InitialContext(ht); javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup("dsname"); Now i want to know that when i am using the same code in a simple class and compile it in jdk 1.3 version. i am getting ...

78. Why we need datasource    coderanch.com

79. Datasource question    coderanch.com

Sorry, I am unable to make a short descriptive title. Well, i have made datasource in tomcat server.xml file. But now i am confuse how to get the connection ... is it the correct syntax Context init = new InitialContext(); Context ctx = (Context)init.lookup("java:comp/env"); DataSource ds=(DataSource)ctx.lookup("jdbc/DB"); I am unable to get connnection using this. Now second question, if i got the ...

80. How use URL directly with DataSource?    coderanch.com

I'd like to take this back a minute and ask, what problem would you like to solve? The idea of a server data source is that server controls the object accross all instances (in most implementations). If an application had the ability to reset a data source, it could affect other applications on the server, as well as performance, pooling, and ...

81. Why don't XADataSource and ConnectionPoolDataSource extend the DataSource interface?    coderanch.com

Can someone explain this logic to me? Why aren't they all DataSources? Wouldn't it have made more sense and cleaner code to have them all be DataSources so that the common elements could be handled the same way and the diff. elements could be handled by casting when needed? Am I missing something?

82. data source reference?    coderanch.com

83. DataSource class    coderanch.com

do you add the JDBC driver to tomcat shared library folder ? you know that a datasource and a connection pool is managed by application server and application server create and take care of them for you. so you need to add the JDBC driver to tomcat shared lib folder. in case that this does not helps , can you past ...

84. Problems with the DataSources.    coderanch.com

Hi everyone, I am using WSAD version 5.1.2. I am using Datasources. I am using a Datasources version 5, When I am trying to using the Datasources from a servlet, It is working fine, but at the console it is giving me this error Resource reference jdbc/ds2 could not be located, so default values of the following are used: [Resource-ref settings] ...

86. Singleton for datasource?    coderanch.com

I have a web application which uses Tomcat's connection pooling. I am paranoid about opening and closing connections efficiently. Does this approach seem reasonable? I use a singleton class to create a single datasource, then use that for opening connections: import java.sql.*; import javax.sql.*; import javax.naming.*; public class MyDataSource { private static MyDataSource mds = new MyDataSource(); public static DataSource ds; ...

87. How to properly declare a DataSource object    coderanch.com

I've done this a lot in my applications, but after reading this article: http://www-128.ibm.com/developerworks/websphere/techjournal/0410_woolf/0410_woolf.html I don't think I will any more. Below is a quote from the article: When the Service Locator pattern was first developed for J2EE 1.2, caching references was a good idea, or at least it didn't hurt anything. But starting in J2EE 1.3, application resource names are ...

88. Datasources and databases    coderanch.com

89. Datasource    coderanch.com

91. import javax.sql.DataSource not found    coderanch.com

Ahh.. Found it under the j2ee.jar in the standard libraries. Specifically under the system var WAS_EE_V51 in the lib directory in the j2e3.jar WAS_EE_V51/lib/j2ee.jar The WAS_EE_V51 variable is mapped to C:/Program Files/IBM/WebSphere Studio v5.1.1/runtimes/ee_v51 So for those of you who have the same issue with WSAD 5.1 you can look there to find many of the system jars that you may ...

92. WAS 6.1 DataSource 5 Char Problem    coderanch.com

Hi. I have the following Problem with my Result i'm getting from the database. I'm using WAS 6.1 a V5 DataSource from it, on the other end i have a Oracle 10g Database. The Problem is that i'm executing a Query on a Table with a CHAR(20) column. The Result of the Query if i execute it on a DB-Cleint looks: ...

93. DataSource creation    coderanch.com

Thank you for the reply paul, i successfully connect to database using datasource-JdbcOdbcDriver but i am trying to connect using OracleDriver it throws exception like: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver class 'oracle.jdbc.driver.OracleDriver' at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:766) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) at jdbcapp.CreateDatabase.doGet(CreateDatabase.java:40) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at ...

97. datasource question    coderanch.com

Suppose I create a datasource and a JNDI name to access a database and I set up this in my application server websphere. In order for my java code to use this data source, do I have to deploy my java code to the application server ? I know if I do that that should work. But what if I just ...

98. JDBC : Data Source Not Found    coderanch.com

99. Could not find datasource    coderanch.com

Hi All, I am using Websphere. I have created a Data sources with JNDI : jdbc/com/sony/pip/pipdb. I have deployed the ear and trying to run the application but i am getting the following error. Please help me in this. FATAL: Could not find datasource: java:comp/env/PIPDataSource Mar 28, 2008 8:58:15 AM org.hibernate.connection.DatasourceConnectionProvider FATAL: MSG_EXCEPTION_LOGGED Mar 28, 2008 8:58:15 AM com.sony.pip.util.HibernateUtil SEVERE: Building ...

100. DataSource in stand alone javafile?    coderanch.com